Components of an Application

Components of applications built with the LabVIEW Model Interface Toolkit, including targets, LabVIEW applications, and models.

An application built with the LabVIEW Model Interface Toolkit typically consists of the following components:

  • Target—The system on which you run the application and the model. You can run a model on a Microsoft Windows target or on a supported NI Real-Time (RT) target.
  • LabView application—The LabVIEW code that uses the Model Interface API to run and interact with a model. The block diagram of the VI contains the code that steps the model. The code also transfers data to and from the model.
  • Model—A model is a mathematical representation of a real-world system, such as the plant and controller, in a closed-loop control system. Models run on hardware targets. They respond to stimuli from other system components. Models produce outputs that simulate the behavior of the modeled item. Models also can serve the functions of signal generation, signal analysis, and control.
  • When the target runs the LabVIEW application, the Model Interface API loads the model and iteratively executes the model. The API transfers data to and from the model and other parts of the system.

    Additional Components in Applications that Include Hardware

    If you intend to run your test application on an RT target or integrate I/O from hardware, you might need the following components:

  • LabVIEW Real-Time Module Component—You need this module to run a deterministic RT simulation.
  • LabVIEW FPGA Module Component—You need the FPGA Module to interact with FPGA I/O.
  • Driver Software Component—You need the appropriate driver software, such as NI-DAQmx, NI-RIO, or NI-XNET to communicate with hardware installed in a target.
  • Components of a Model

    Models can contain the following components through which tuning, data communication, and debugging occurs:

  • Inport and Outport Components—To communicate with other parts of the control system, models contain inputs and outputs, called inports and outports. You can transfer data between an inport or outport and hardware inputs and outputs, other models in the system. Inports and outports are dynamic values the Model Interface API updates each time step the model executes.
  • Parameter Components—Parameters act like variables in the model. Unlike inports, whose values come from elsewhere in the system and change frequently, users typically manipulate parameters infrequently to tune the behavior of the simulation. For example, an operator might set a parameter before the model starts to run or update its value between the execution of discrete tests.
  • Signal Components—Signals serve as probes, or test points, of a model as it runs. For example, you might want to monitor the value a function produces for the model to use internally if the value is not available through an outport.
  • Consider a system that contains a physical motor controller and a model that represents a DC motor. The model runs on a hardware target. Such a model might contain the following components:

    • An inport that accepts the motor command from the motor controller.
    • An outport that returns the motor speed from the model.
    • Parameters that adjust the load on the motor. You might set parameter values once per test rather than updating them frequently during the test.
    • A signal that returns internal data that aids in debugging.

    Building and Preparing Models for Use in LabVIEW

    You can build models using several different modeling environments. You must compile a model in the modeling environment before it can run in your application. The exact process for compiling a model to interact with the LabVIEW Model Interface Toolkit depends on the modeling environment you use to build it.

    Note

    For more information on preparing the model for use with the Model Interface API, see the Compiling Models section.

    If you create the model in a modeling environment not covered in the Compiling Models section, refer to the documentation for that modeling environment.

    Integrating Models into the LabVIEW Application

    When you build your test application in LabVIEW, you connect parts of the model to sources of I/O in other parts of the application. For example, you might pass data from a hardware channel to a model inport so the model receives and operates on data from the hardware device. You must also configure timing and choose how to interact with parameters and signals in the model.

    You can use the Model Interface Toolkit VIs for the following tasks:

    • Control the execution of models
    • Monitor status and timing
    • Configure parameters
    • Read signals as the models run