Components of an Application (Model Interface Toolkit)
- Updated2023-02-21
- 4 minute(s) read
Components of an Application (Model Interface Toolkit)
An application built with the Model Interface Toolkit typically consists of the following components:
- Target—The computer on which you run the application and model. You can run a model either on a Windows target or on a supported National Instruments 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, transfers data to and from the model, and so on.
- 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 and are typically used to respond to stimuli from other parts of the system by producing outputs in a way that simulates 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, transferring 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—You need this module to run a deterministic RT simulation.
- LabVIEW FPGA Module—To interact with FPGA I/O, you need the FPGA Module.
- National Instruments Driver Software—You need the appropriate National Instruments driver software, such as NI-DAQmx, NI-RIO, or NI-XNET, to communicate with hardware installed in a target.
The remainder of this topic describes tasks you typically perform to create and integrate a model into a LabVIEW application using the Model Interface API.
Components of a Model
Models can contain the following components through which tuning, data communication, and debugging occurs:
- Inports and Outports—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, and so on. Inports and outports are dynamic values the Model Interface API updates each time step the model executes.
- Parameters—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 executing or update its value between the execution of discrete tests.
- Signals—Signals serve as probes, or test points, of a model as it executes. For example, you might want to monitor the value a function produces for the model to use internally if the value will not be 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 Model Interface Toolkit depends on the modeling environment you use to build it. Refer to the appropriate resource for your specific modeling environment for information about preparing the model for use with the Model Interface API:
If you build the model in some other modeling environment, refer to the modeling environment documentation for information on how to compile your model to be compatible with the Model Interface API.
Related Links
Support for Model Types and Modeling Environments
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 also must configure timing and choose how to interact with parameters and signals in the model.
Use Model Interface Toolkit VIs to control the execution of models, monitor their status and timing, configure their parameters, and read from their signals as the models run.