Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Creating a Host VI (Simulation Interface Toolkit)

LabVIEW 2010 Simulation Interface Toolkit Help

Edition Date: June 2010

Part Number: 371504F-01

»View Product Info
Download Help (Windows Only)

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.

  1. Launch LabVIEW on the host computer.
  2. Create a new blank VI.
  3. Add two knob controls to the front panel. Label the first control Amplitude and the second control Frequency.
  4. 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.

  1. 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.
  2. Under Execution Host, select Simulation Environment.
    Note��The execution host is the machine on which the SIT Server is running. If you want to select Real-Time Target or Driver VI on Localhost, you must convert your model to a model DLL before you can create mappings.
  3. 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.
  4. Click the OK button. The Current Model file path indicator updates to show the path to sinewave.mdl.
  5. From the Category list, select Mappings to display the Mappings page. The Current Mappings table displays the controls and indicator you created.
  6. 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.
  7. 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.
  8. Map the Frequency knob to the Frequency parameter of the Sine Wave block.
  9. 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.
  10. 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.
  11. 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.
  12. 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.
Previous Step
Building a Model

or Converting a Model into a Model DLL
Next Step
Running a Simulation

WAS THIS ARTICLE HELPFUL?

Not Helpful