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

Building a Model (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 build a model in The MathWorks, Inc. Simulink application software that generates a sine wave.

Note��You can find an example of this model in the labview\examples\Simulation Interface\Sine Wave directory.
  1. Launch the The MathWorks, Inc. MATLAB application software on the host computer. The command window displays the following message:

    Starting the SIT Server on Port 6011

    SIT Server started

    This message indicates that the SIT Server is running.
  2. Enter simulink in the command window to launch the Simulink� Library Browser window.
  3. Place a Sine Wave block, located in the Math Operations library, in a new model window.
  4. Place an In1 block, located in the Sources library, in the model window.
  5. Place a Sum block, located in the Math Operations library, in the model window.
  6. Place an Out1 block, located in the Sinks library, in the model window.
  7. Place a SignalProbe block, located in the NI SIT Blocks library, in the model window.
    Note��The LabVIEW Simulation Interface Toolkit uses the SignalProbe block to probe the signals in the model. The SignalProbe block must be on the top level of the model hierarchy. You can have only one SignalProbe block per model file. Do not rename the SignalProbe block. Do not change the name of another model block to SignalProbe. If you installed the MATLAB application software files as read-only, you must modify the matlabrc.m file to see the SignalProbe block in the Simulink Library Browser window.
  8. Wire the sources, functions, and signals together so the model looks like the diagram in the following figure:

  9. Save the model as sinewave.mdl to an easily accessible location.

Setting Simulation Options

Complete the following steps to change simulation options in the Simulink application software.

  1. For the MATLAB application software release 13, select Simulation�Simulation parameters to launch the Simulation Parameters dialog box.

    For the MATLAB application software release 14 and later, select Simulation�Configuration Parameters to launch the Configuration Parameters dialog box.
  2. Click the Solver tab.
  3. Enter inf in the Stop time text box. inf specifies that the simulation runs until you stop the simulation.
  4. Set the Type option to Fixed-step in the Solver Options section.
  5. Click the OK button to return to the Simulink application software window.
  6. Save the model.

The LabVIEW Simulation Interface Toolkit might not be able to probe signals from models that use Signal Storage Reuse or Block Reduction Optimization. Additionally, the Simulation Interface Toolkit might not be able to probe signals that originate from Virtual Blocks. If the model uses any of these options or blocks, you can mark individual signals as test points. Refer to the Simulink documentation for information about these and other simulation options you can set.

Note��You can see a completed version of sinewave.mdl in the labview\examples\Simulation Interface\Sine Wave\ directory.
Next Step
Creating a Host VI

or Converting a Model into a Model DLL

WAS THIS ARTICLE HELPFUL?

Not Helpful