Professional Documents
Culture Documents
NI Tutorial 3057 en
NI Tutorial 3057 en
Overview
The Simulation Interface Toolkit (SIT) provides a seamless integration between The MathWorks Inc. Simulink software and LabVIEW. The Simulation Interface Toolkit automatically generates
LabVIEW code to interface with a Simulink module resulting in a flexible and easy-to-use user interface. You first must congifure the Simulink model to communicate with LabVIEW. Then you
can create a LabVIEW host VI that automatically calls, runs and interacts with the Simulink model.
Table of Contents
1. Configuring the Simulink Model
2. Creating a LabVIEW User Interface
3. Attachments
1/3
www.ni.com
4. You can now create the mappings between the VI and the Simulink model. From the VI, select Tools>>SIT Connection Manager.
5. In the Model and Host category, select Simulation Environment under Host Execution. 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 Local host, you must convert your Simulink model to a DLL before you can create mappings.
6. Under Current Model, select Browse and select the sinewave.mdl file.
7. Under Project Directory, select Browse and select the folder in which you want your project to be contained. Ideally, this should be the same folder that you model is located in.
8. From the Category list, select Mappings to display the Mappings page. The Current Mappings table shows the controls and indicators you created earlier on the front panel. You will use
this page to map your front panel items to the Simulink model.
9. Highlight the Frequency control in the Current Mappings table and click the Change Mappings button. This will bring up the Specify Parameters for Control dialog box.
10. From this dialog box, select Frequency from the sinewave>>Sine Wave tree and click OK.
2/3
www.ni.com
11. Map the remaining objects. Map the Amplitude control to the Amplitude from the sinewave>>Sine Wave tree. Map the Sine Wave indicator to the Port 1 from the sinewave>>Sum tree.
12. Click the OK button to close the SIT Connection Manager dialog box and generate the block diagram code for the VI. Notice there are now Model Controls on your front panel. You can use
these controls to control the model from the VI.
13. Notice the block diagram now contains code. DO NOT MODIFY ANY of the code with green labels.
You can run the VI and control the simulation with the Model Controls. The Frequency and Amplitude knob controls can be used to change the sine wave output.
This process described here does not require the MathWorks Real-Time Workshop. This VI uses Simulink to run the simulation. You also can use the Simulation Interface Toolkit together with
the Real-Time Workshop to build the model into a DLL for stand-alone simulation. You need MATLAB, Simulink, and Real-Time Workshop to build a model DLL and configure the user
interface. You need only LabVIEW to run the simulation. For hardware-in-the-loop (HIP) and prototyping applications, you can run the model DLL in LabVIEW Real-Time to provide real-time
inputs and outputs and to ensure determinism.
MATLAB, Simulink, and Real-Time Workshop are registered trademarks of The MathWorks, Inc. Other product and company names listed are trademarks and trade names of their respective
companies.
3. Attachments
Related Links:
LabVIEW 2010 Help: Simulation Interface Toolkit
Developer Zone Tutorial: Using NI-DAQmx with the LabVIEW Simulation Interface Toolkit
KnowledgeBase KB47IG4V3N: What Software Will I Need to Use the Simulation Interface Toolkit?
3/3
www.ni.com