Complete the following steps to create a host VI for the sinewave model.
Creating the Front Panel of the Host VI
- Launch LabVIEW on the host computer.
- Create a new blank 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.
- Click the Mappings tab.
- Add a knob to the front panel of the host VI. The Current Mappings table in the SIT Connection Manager dialog box updates to show the knob.
- Label the knob Amplitude. The Current Mappings table updates to show Amplitude as the name of the knob.
- Add another knob labeled Frequency.
- Add a waveform chart indicator to the front panel of the host VI.
- Label the waveform chart Sine Wave. The front panel of the host VI looks like the following figure:

Creating Mappings between the Host VI and the Model
-
Click the Model and Host tab of the SIT Connection Manager dialog box.
- Click the Change button next to the Current Model file path indicator.
- Select sinewave.mdl from 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.
- Click the Mappings tab.
-
Select the Amplitude control in the mappings table and click the Change Mapping button to launch 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.
- Click the OK button to 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.
- Return to the Mappings tab of the SIT Connection Manager dialog box.
- Double-click the row containing the Sine Wave indicator to launch 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. If you have not saved the host VI already, LabVIEW prompts you for a location to save the host VI.
- Enter Sine Wave.vi and click the OK button. The LabVIEW Simulation Interface Toolkit generates the block diagram code of 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.
 |
Note You can see a completed version of Sine Wave.vi in the labview\examples\Simulation Interface\Sine Wave\ directory. |