Conversion Process for Models from MathWorks Simulink® Software

Before you can run a model you created in MathWorks Simulink® software with the Model Interface API, you must use the Simulink software to convert the model file to a compiled model. The Simulink software performs the following process:

  1. When you build the compiled model, MathWorks Real-Time Workshop® software converts your model and any submodels into a C/C++ code version of the same model. The resulting C/C++ code version of your model is the same Simulink block diagram model, just in a different form.
  2. A compiler, such as Microsoft Visual C++, compiles the C/C++ code model into the appropriate file type. For example, the Microsoft Visual C++ compiler creates a file named ModelName.dll, ModelName.out, or ModelName.so, where ModelName is the name of the model.
    Note   Shared libraries used by LabVIEW VIs must exist in either the ni-rt/ or the ni-rt/system/ directory. LabVIEW ignores paths specified in the Call Library Node.
  3. The Real-Time Workshop software places the compiled model file in one of the following directories located in the current working directory:
    • (NI Linux Real-Time) <ModelName>_NIVeriStand_Linux_ARM_32_rtw or ModelName>_NIVeriStand_Linux_64_rtw
    Note   A text file, <ModelName>_portsReadme.txt, is also generated, which specifies the lengths and positions of all model inport and outport array data.

The following figure shows this conversion process.

Figure 2.

The tools you use to convert a Simulink model, such as Microsoft Visual C++ and the GNU Toolchain, differ according to the type of target that will run the model. However, the previous conversion process is generally the same across targets. Refer to the following KnowledgeBase document at ni.com for a list of the versions of the LabVIEW, Windows, model compiler, and MathWorks software you can use with the Model Interface Toolkit: VeriStand Version Compatibility. Prerequisites for Compilation

To compile a Simulink model, the VeriStand Model Framework must be installed on the computer with the Simulink software. The VeriStand Model Framework adds tools to the Simulink software that allow you to compile models that work with the Model Interface API.