Instrumentation Apps for Real-Time Applications
R2026bTo visualize the behavior of a real-time application running on a target computer, you can create instrument panel apps. An instrument panel app is a user-interface application into which you can insert one or more instruments. To create an instrument panel app, use App Designer or a MATLAB® M-script.
When you create an instrument panel app in the App Designer Design View, you add instrument components from the App Designer Component Library to the app. You configure each instrument by using fields in the Component Browser. In the App Designer Code View, you add callback code to handle component events, such as new streaming data or interaction with the app. For more information, see App Building Components and Manage Code in App Designer Code View.
When you create an instrument panel app by using a MATLAB M-script, you use a programmatic approach to add each instrument to the panel as UI component. For more information, see Create Callbacks for Apps Created Programmatically.
To stream signal and parameter data to the instrument panel app from the real-time
application, you use the Instrument
object. After you create an instrument object for a real-time application, you can use
instrument object functions to connect signals and parameters from the real-time application
to instrument panel app callbacks.
When identifying parameters and output signals to stream signals to the instrument panel app from the real-time application, it can be helpful to use the hierarchical display of signals and parameters. See Simulink Real-Time Explorer. For more information, see Filter Hierarchical List of Signals and Parameters in Simulink Real-Time Explorer.
Using one instrument is the most efficient way for a real-time application to stream or log signals. But, there are cases for which you might want to consider adding real-time application signals into separate instruments. For example:
When you would like to disable visualizations for some signals in your app while continuing visualizations for others, grouping signals into separate instruments can be helpful. If using this approach, you can disable an instrument to stop streaming or logging signals in that instrument without affecting the visualizations for other instruments in the app.
When you would like to use modular design in models and create an instrument for each application, this approach can let you re-use instruments each time you want to visualize signals from a particular application in your app. This approach is possible if you add signals by name to an instrument, because this approach keeps the signal independent of any particular real-time application.
See Also
Simulink Real-Time
Explorer | Instrument
Topics
- Add App Designer App to Inverted Pendulum Model
- Create App Designer Instrument Panels by Using Simulink Real-Time Components
- Create Standalone Instrument Panel App Using Standalone Application Compiler
- App Building Components
- Manage Code in App Designer Code View
- Filter Hierarchical List of Signals and Parameters in Simulink Real-Time Explorer