LabVIEW 2010 Simulation Interface Toolkit Help
»View Product Info
Complete the following steps to create a host VI and map it to a model or model DLL.
||Note��For demonstration purposes, this procedure uses the sinewave.mdl file you created in the Building a Model procedure. You can follow a similar process to create host VIs for your other model files or model DLLs.
Creating the Front Panel of the Host VI
Complete the following steps to create the front panel of a host VI for the sinewave model.
- Launch LabVIEW on the host computer.
- Create a new blank VI.
- Add two knob controls to the front panel. Label the first control Amplitude and the second control Frequency.
- Add a waveform chart indicator to the front panel and label the indicator Sine Wave. The front panel of the host VI resembles the following figure:
Creating Mappings between the Host VI and the Model
Complete the following steps to create mappings between the host VI and the sinewave model.
From the host VI, select Tools�SIT Connection Manager to launch the SIT Connection Manager dialog box. You use this dialog box to establish mappings between LabVIEW controls/indicators and model parameters/signals. This dialog box also contains options for the simulation such as data logging.
- Under Execution Host, select Simulation Environment.
- Click the Browse button next to the Current Model field to navigate to the sinewave.mdl file. A copy of this file is located in the labview\examples\Simulation Interface\Sine Wave\ directory.
- Click the OK button. The Current Model file path indicator updates to show the path to sinewave.mdl.
- From the Category list, select Mappings to display the Mappings page. The Current Mappings table displays the controls and indicator you created.
Select the Amplitude control and click the Change Mapping button to display the Specify Parameter(s) for Control dialog box. You also can access this dialog box by double-clicking the row containing the Amplitude control.
- Select Amplitude from the sinewave�Sine Wave tree and click the OK button to map the knob to the Amplitude parameter of the Sine Wave block and return to the SIT Connection Manager dialog box. The Mapped Parameter/Signal column updates to show the mapping you just created.
- Map the Frequency knob to the Frequency parameter of the Sine Wave block.
- Double-click the row containing the Sine Wave indicator to display the Specify Signal(s) for Indicator dialog box. This dialog box contains model signals, whereas the Specify Parameter(s) for Control dialog box contains model parameters.
- Double-click Port 1 under the sinewave�Sine Wave tree to create the mapping and return to the SIT Connection Manager dialog box.
||Note��To remove a mapping, select a row in the mappings table and click the Remove Mapping button. To change a mapping, select a row in the mappings table and click the Change Mapping button.
- Click the OK button to close the SIT Connection Manager dialog box and generate the block diagram code for the host VI. If you have not saved the host VI already, LabVIEW prompts you for a location to save the host VI. You do not need to edit this code because the generated code already contains the necessary VIs and functions to interact with sinewave.mdl.
- Save the host VI as Sine Wave.vi.
||Note��You can see a completed version of Sine Wave.vi in the labview\examples\Simulation Interface\Sine Wave\ directory.