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

Converting a Model into a Model DLL (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 convert a model into a model DLL. You can convert models that use only a fixed step-size ordinary differential equation (ODE) solver. Additionally, you must turn off data logging in The MathWorks, Inc. Simulink application software and instead log simulation data using the Data Logging page of the SIT Connection Manager dialog box. Refer to the Simulink documentation for information about using the Simulink application software to change the ODE solver of a model and turn off data logging.

Note��If you do not have a compiler set up to compile the C code, or if you have set up an unsupported compiler, you must run mex -setup in the The MathWorks, Inc. MATLAB application software before converting a model into a model DLL.
  1. Launch the Simulink application software and load the model you want to convert.
  2. 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.
  3. Click the Real-Time Workshop tab.
  4. Click the Browse button to launch the System Target File Browser dialog box.
  5. Select nidll.tlc—NI Real-Time Target from the list.
  6. Click the OK button.
  7. Click the Build button in the Category section to begin building the model DLL. The MATLAB command window displays the status of the build process. The following message in the MATLAB command window indicates that Real-Time Workshop has completed building the model DLL.

    ### Successful completion of Real-Time Workshop build procedure for model:ModelName

After Real-Time Workshop builds a model DLL, the LabVIEW Simulation Interface Toolkit places the model DLL in a directory named <ModelName>_nidll_rtw, which is located in the current working directory. The Simulation Interface Toolkit also generates a text file, <ModelName>_portsReadme.txt, which specifies the lengths and positions of all model input and model output array data.

Including External Source Code in a Model DLL

If the model you are converting specifies any .c or .h files, you must specify the locations of these files so the Simulation Interface Toolkit includes the code in the model DLL. Both of these changes require editing the makefile nidll_vc.tmf, which is located in the C:\SimulationInterfaceToolkit\ModelInterface\tmw\ directory.

Complete the following steps to specify a directory containing .h files a model uses.

  1. Open nidll_vc.tmf in any text editor.
  2. Locate the line that reads USER_INCLUDES = .
  3. Add directory paths, separated by spaces, between the quotes. For example, USER_INCLUDES ="-Ic:\source1 -Ic:\source2".
  4. Save the file and close the text editor.

Complete the following steps to specify any .c files a model uses.

  1. Open nidll_vc.tmf in any text editor.
  2. Locate the line that reads USER_SRCS = .
  3. Add file locations, separated by spaces, between the quotes. For example, USER_SRCS ="c:\source1\mySource1.c c:\source2\mySource2.c".
  4. Save the file and close the text editor.

Refer to the Real-Time Workshop documentation for more information about makefiles and how Real-Time Workshop generates C code.

Previous Step
Building a Model
Next Step
Creating a Host VI

or Specifying the Model DLL and Execution Host

WAS THIS ARTICLE HELPFUL?

Not Helpful