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

Components of a Simulation (Simulation Interface Toolkit)

LabVIEW 2010 Simulation Interface Toolkit Help

Edition Date: June 2010

Part Number: 371504F-01

»View Product Info
Download Help (Windows Only)

A simulation consists of the following components:

  • Model—A simulation block diagram in graphical form, another source code form (e.g., C code), or compiled form. Models contain inputs and outputs that send and receive data. Models contain parameters you can manipulate and signals whose values you can view. For example, a model that generates a sine wave contains parameters that adjust the amplitude and frequency of the sine wave. You can view the value of the sine wave using the model signal. Models can be built using The MathWorks, Inc. Simulink application software. You can run a model either on a Windows computer or on a supported National Instruments real-time (RT) target.
  • Host VI—The VI that you use to manipulate a model. The host VI consists of a front panel and a block diagram. You use front panel controls to manipulate model parameters. For example, you can use a control to change the amplitude of a sine wave. You use front panel indicators to view the values of the model signals. For example, you can use a waveform chart to view a sine wave as you change the amplitude.

    The block diagram of the host VI contains the code that defines mappings between front panel controls/indicators and model parameters/signals. You create a host VI using LabVIEW and the SIT Connection Manager dialog box.
    Note��Advanced users can create a host VI using the User Interface VIs.
  • SIT Server—The server that uses a TCP/IP connection to transmit data between the host VI and the model. You must launch the SIT Server, which starts automatically when you launch The MathWorks, Inc. MATLAB application software, before running a simulation. By default, the SIT Server runs on port 6011.
  • Host Computer—The computer on which you run the host VI. The host computer must be a PC running Windows 7/Vista/XP/Server 2008 (64-bit)/Server 2003 (32-bit).
    Note��The LabVIEW Simulation Interface Toolkit runs as a 32-bit application on all operating systems.
  • Execution Host—The computer on which you run the MATLAB application software, the SIT Server, and the simulation itself. The execution host can be the host computer or a Windows computer on the same TCP/IP network as the host computer.

The following figure shows how these components work together:

When you run the host VI, the diagram code initializes the simulation and defines the relationship between host VI controls/indicators and model parameters/signals. As you change the values of front panel controls, the simulation executes the following steps:

  1. The host VI block diagram uses TCP/IP to send the new parameter values to the SIT Server.
  2. The SIT Server transmits these new parameter values to the model.
  3. The model uses these new parameter values to execute the blocks, which update the appropriate signal values.
  4. The SIT Server probes the model signals for which you created mappings.
  5. The SIT Server transmits the new signal values to the host VI, which updates the front panel indicators.

Real-Time Simulations

You can use the LabVIEW Simulation Interface Toolkit to run a simulation on a real-time (RT) target. The Simulation Interface Toolkit supports certain types of National Instruments RT Series hardware. You also can execute an RT simulation on a Windows computer.

RT simulations involve the following additional components:

  • LabVIEW Real-Time Module—You need this module to run a deterministic RT simulation.
  • LabVIEW FPGA Module—(Optional) If you are creating mappings between National Instruments FPGA targets and a model DLL, any FPGA target you specify must have an associated FPGA lvbit file. The Simulation Interface Toolkit provides FPGA lvbit files for the NI PXI-7831R, NI PCI-7831R, and NI PXI-7811R. If you want to customize these FPGA VIs or create an FPGA VI for another FPGA target, you need the FPGA Module.
  • National Instruments Driver Software—You need the appropriate National Instruments driver software to communicate with hardware installed in an RT target. For FPGA targets, you need NI-RIO3.0 or later. For CAN interfaces, you need NI-CAN 2.6 or later. For DAQ devices, you need NI-DAQmx 8.7.2 or later.
  • Driver VI—The VI that manipulates the model DLL. The driver VI and the model DLL run on an RT target. You manipulate the driver VI with a host VI. You create a driver VI using the SIT Connection Manager dialog box.
  • Model DLL—A model compiled to run on an RT target. You enable a model to run on an RT target by using The MathWorks, Inc. Real-Time�Workshop and Microsoft Visual C++.

    To enable a model to run on an RT target, Real-Time Workshop converts the model and any subsystems into a C code version of the model. Note this C code version of the model is the same Simulink block diagram model, just in a C code form. Microsoft Visual C++ then compiles the C code model into a model DLL named ModelName.dll, where ModelName is the name of the model. Real-Time Workshop places the model DLL into the current working directory. The following figure shows this conversion process.



    The LabVIEW Simulation Interface Toolkit supports Microsoft Visual C++ 6.0, Microsoft Visual C++ .NET 2003, Microsoft Visual C++ .NET 2005 (Professional or Express), and Microsoft Visual C++ .NET 2008 (Professional or Express).
    Note��Advanced users can create a driver VI using the Model Interface VIs.
  • SIT Server—The SIT Server transmits data between the host VI and the driver VI. If you do not need to communicate with an RT simulation, you can run an RT simulation without the SIT Server. You do not need to launch the MATLAB application software to run a simulation on an RT target.

The following figure shows how these components work together:

When you run the host VI, the Simulation Interface Toolkit downloads the model DLL and driver VI to the RT target. The Simulation Interface Toolkit then starts the SIT Server on the RT target, and the driver VI initializes the model DLL. As you change the values of front panel controls, the simulation executes the following steps:

  1. The host VI block diagram uses TCP/IP to send the new parameter values to the SIT Server.
  2. The driver VI transmits these new parameter values to the model DLL.
  3. The model DLL uses these new parameter values to execute the C code and update the appropriate signal values.
  4. The driver VI probes the model signals for which you created mappings.
  5. The SIT Server transmits the new signal values to the host VI, which updates the front panel indicators.

WAS THIS ARTICLE HELPFUL?

Not Helpful