Export and Import Signals in Instrument by Using Simulink Real-Time Explorer
When testing a complex model with many signals, you frequently must select signals for file logging or streaming from multiple parts and levels of the model hierarchy.
Save Signals to Disk
You can make this task easier by using Simulink® Real-Time™ Explorer to select the signals in instrument and save the list of signals to disk.
Open model
slrt_ex_osc
.Build the real-time application for the target computer. In the Simulink Editor Real-Time tab, click Run on Target > Build Application.
Open Simulink Real-Time Explorer. Click Prepare > SLRT Explorer.
Connect to the target computer and load the real-time application. In Simulink Real-Time Explorer, click Load Application. Select the
slrt_ex_osc
application from the Applications on target computer list and click Load.To add signals to the signals in instrument, export the list of signals, and import the list of signals, click the Signals tab..
Select the signals to visualize from the list and then click Add to signals in instrument .
Or, select the signals to visualize from the list, right click and select
Add To Instrument List
.Then, click Add Instrument.
To export the list, click Export instrument to file . Name the files and click Save.
To remove signals from the signals in the instrument, select the signals in the list, and then click Remove signals from instrument .
To import the list, click Import instrument from file . Select the file and click Open.
Get MATLAB Code for Signals
When developing an App Designer application or an m-script that connects to a real-time application, it is helpful to have MATLAB code for the signals in the instrument. This code provides access to signals in an Instrument object (or instrumented signals), which are signals that are configured for streaming signal data from a real-time application. To generate this code from the Signals in Instrument:
In Simulink Real-Time Explorer, click Load Application. Select the
slrt_ex_osc
application from the Applications on target computer list and click Load.Click the Signals tab.
Select the signals to visualize from the list, and then click Add to signals in instrument .
To create MATLAB code for the signals in the instrument, click Generate MATLAB code to create Instrument programmatically . An editor window opens in MATLAB and displays the code for the signals in the Instrument.
See Also
Instrument
| addSignal
| connectLine
| connectScalar
| validate