Generating Compiled Models from VIs

NI VeriStand 2018 Help

Edition Date: May 2018

Part Number: 372846M-01

»View Product Info
Download Help (Windows Only)

You can convert LabVIEW VIs into compiled models you can use in the NI VeriStand environment. If you have the Control Design and Simulation Module installed, you also can convert simulation subsystems.

Note  This procedure requires the following products:
  • LabVIEW development system—Use the same year version of LabVIEW as your NI VeriStand installation. For example, NI VeriStand 2011 requires LabVIEW 2011.
  • LabVIEW Application Builder—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.

Complete the following steps to generate a compiled model you can use in NI VeriStand:

  1. Create a VI or simulation subsystem that performs the actions you require from your simulation model.
  2. Configure the connector pane for your VI or subsystem using guidelines for preparing VIs to be converted to a compiled model.
  3. Save the VI or subsystem.
  4. In LabVIEW, select Tools»NI VeriStand»Generate Model from VI to display the Generate NI VeriStand Model from VI dialog box.
  5. In the Source VI Path field, enter the path where you saved the source file.
  6. In the Destination Folder field, enter the path where you want to save the generated model.
  7. (Control Design and Simulation Module) If your source file is a simulation subsystem, click the Next button and complete the following steps.
    1. 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 model Decimation, or the model Decimation divided by the Target Rate:

      model time step (sec) = Controller Period*Decimation


      model time step (sec) = Decimation/Target Rate

      where Controller Period = 1/Target Rate. You specify the Target Rate on the Controller Configuration page of the System Explorer window. You specify the Decimation on the Model Configuration page of the System Explorer window.
      Note  Because there is no simulated time in a standard VI, the previous equation applies only to compiled models you generate from simulation subsystems.
    2. Specify the ODE Solver.
  8. Click the Build button. The Generate NI VeriStand 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 when you add it to a system definition, refer to the guidelines for preparing VIs to be converted to a compiled model.

Moving the Model and Support Files

If you deploy the compiled .lvmodel or .lvmodelso to an RT target, NI VeriStand 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 computer, you also must move the following support files to maintain relative paths:

  • A .depvs file that LabVIEW creates alongside the .lvmodel or .lvmodelso file to reference the dependencies.
  • Any LabVIEW DLLs, such as NILVSim.dll for a simulation subsystem, located in a subdirectory named data in the destination folder where LabVIEW generates the compiled model.
Note  You must install additional software to enable LabVIEW models for targets running a Linux Real-Time OS (.lvmodelso files). For more information about how to use LabVIEW models with Linux, visit the NI website.

Related Information

Refer to the Adding and Configuring Models section of the NI VeriStand Help, available by browsing to Integrating and Executing Models on the Contents tab, for information about how to add a model to a system definition file.

Adding and Configuring Models

Using LabVIEW VIs as Models Purchase the Application Builder


Not Helpful