Generating Compiled Models from VIs
- Updated2026-05-07
- 3 minute(s) read
Convert LabVIEW VIs or simulation subsystems into compiled models for use with the Model Interface API and Linux Real-Time OS targets.
Prerequisite Software
To compile models in LabVIEW, you must install the following software components:
- The LabVIEW Model Support feature
- The LabVIEW Application Builder, which is included with the LabVIEW Professional Development System. If you use the LabVIEW Base Development System or Full Development System, you can purchase the Application Builder separately.
Generating a Compiled Model
- Create a VI or simulation subsystem that performs the actions you want from your simulation model.
- Configure the connector pane for your VI or subsystem.
- Save the VI or subsystem.
- In LabVIEW, select to display the Generate Model from VI
dialog box. Note The LabVIEW Model Interface Toolkit shares several components with the VeriStand, such as tools for compiling models.
- In the Source VI Path field, enter the path where you saved the source file.
- In the Destination Folder field, enter the path where you want to save the generated model.
- If your source file is a simulation subsystem, click the
Next button and complete the following steps:
- Specify a value for the model time step (sec), which is the
interval between the times the ODE Solver evaluates the model and
updates the model output, in seconds. For your compiled model to run in
real-time, the model time step (sec) value must
equal the controller period multiplied by the
Decimation model, or the
Decimation model divided by the Target Rate:Model time step (sec) = Controller Period x Decimation
or
Model time step (sec) = Decimation/Target RateWhere
Controller Period = 1/Target Rate - Specify the Target Rate on the Controller Configuration tab of the System Explorer window.
- Specify the Decimation on the Model
Configuration tab of the System
Explorer window. Note The equation only applies to compiled models you generate from simulation subsystems, because there is no simulated time in a standard VI.
- Specify the ODE Solver.
- Specify a value for the model time step (sec), which is the
interval between the times the ODE Solver evaluates the model and
updates the model output, in seconds. For your compiled model to run in
real-time, the model time step (sec) value must
equal the controller period multiplied by the
Decimation model, or the
Decimation model divided by the Target Rate:
- Click the Build button. The Generate Model from
VI dialog box displays the progress of the model
generation.Note If you experience errors when converting a VI or if the model does not contain the inports, outports, and parameters you expect, see the Preparing VIs to Be Converted to a Compiled Model section.
Moving the Model and Support Files
If you deploy the compiled .lvmodel or .lvmodelso to an RT target, LabVIEW copies required .dlls to the target automatically. However, if you manually copy the .lvmodel or .lvmodelso file to a new location, such as a different host system, you must also move any LabVIEW .dlls, such as NILVSim.dll for a simulation subsystem. The files are stored in a subdirectory named data in the destination folder where LabVIEW generates the compiled model.
Related Information
- Compiling Models
Compile models compatible with the LabVIEW Model Interface Toolkit.
- Using LabVIEW VIs as Models
Convert LabVIEW VIs into compiled models for use with the LabVIEW Model Interface Toolkit or VeriStand systems.
- Software and Driver Downloads