Generating Compiled Models for NI VeriStand

NI VeriStand� 2010 Help

Edition Date: August 2010

Part Number: 372846B-01

»View Product Info
Download Help (Windows Only)

The NI VeriStand LabVIEW Model Generator converts LabVIEW VIs into compiled models you can use in the NI VeriStand environment. The NI VeriStand LabVIEW Model Generator also works with simulation subsystems you create using the LabVIEW Control Design and Simulation Module. Refer to the National Instruments Web site at ni.com to purchase this module.

This feature enables you to use LabVIEW G code to write models that add system simulation, closed-loop control, and other functionality to NI VeriStand applications. You then can use the configuration-based NI VeriStand environment to configure hardware I/O, stimulus profiles, custom devices, and other features supported by NI VeriStand, and to deploy your model to real-time targets.

Note��The NI VeriStand LabVIEW Model Generator requires LabVIEW 2010 or later and the Application Builder, which is included with the LabVIEW Professional Development System. If you use the LabVIEW Base Package or Full Development System, you can purchase the Application Builder separately by visiting the National Instruments Web site at ni.com.

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. Only inputs and outputs you add to the connector pane appear when you load the generated model in NI VeriStand. Required inputs appear as model inports, optional inputs appear as model parameters, and all outputs appear as model outports.
    Note��NI VeriStand supports the following data types for model inports, outports, and parameters: numerics, Booleans, 1-dimensional arrays of numerics or Booleans, clusters of numerics or Booleans, and 1-dimensional arrays of clusters of numerics or Booleans.
  3. Save the VI or subsystem.
  4. Select Tools�NI VeriStand�Generate NI VeriStand 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) 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, or Target Rate, multiplied by the model Decimation:

      model time step (sec) = Target Rate * Decimation

      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.

The NI VeriStand LabVIEW Model Generator saves the generated compiled model (.lvmodel file) in the Destination Folder you specified. This folder also contains associated support files. If your source file depends on any LabVIEW DLLs, such as NILVSim.dll for a simulation subsystem, LabVIEW creates a data subdirectory in the Destination Folder to store the DLLs and a .depvs file to reference the dependencies. If you move the .lvmodel file, you also must move the data subdirectory and .depvs file to maintain relative paths.

After you generate the compiled model, you can add it to a system definition file in NI VeriStand as you would any other compiled model.

Note��If you deploy the compiled model to an RT target, NI VeriStand copies required DLLs to the target automatically. You only need to move the data subdirectory and .depvs file if you manually copy the compiled model to a new location, such as a different host computer.

Refer to the NI VeriStand Help for more information on adding a model to a system definition fileand for general information on using models in NI VeriStand.

WAS THIS ARTICLE HELPFUL?

Not Helpful