Main Content

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.

  1. Open model slrt_ex_osc.

  2. Build the real-time application for the target computer. In the Simulink Editor Real-Time tab, click Run on Target > Build Application.

  3. Open Simulink Real-Time Explorer. Click Prepare > SLRT Explorer.

  4. 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.

  5. To add signals to the signals in instrument, export the list of signals, and import the list of signals, click the Signals tab..

  6. Select the signals to visualize from the list and then click Add to signals in instrument Add to signals in instrument button.

    Or, select the signals to visualize from the list, right click and select Add To Instrument List.

    Add to instrument list context menu

    Then, click Add Instrument.

  7. To export the list, click Export instrument to file Export instrument to file button. Name the files and click Save.

  8. To remove signals from the signals in the instrument, select the signals in the list, and then click Remove signals from instrument Remove signals from instrument button.

  9. To import the list, click Import instrument from file Import instrument from file button. 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:

  1. In Simulink Real-Time Explorer, click Load Application. Select the slrt_ex_osc application from the Applications on target computer list and click Load.

  2. Click the Signals tab.

  3. Select the signals to visualize from the list, and then click Add to signals in instrument Add to signals in instrument button.

  4. To create MATLAB code for the signals in the instrument, click Generate MATLAB code to create Instrument programmatically Generate MATLAB code to create instrument programmatically button. An editor window opens in MATLAB and displays the code for the signals in the Instrument.

See Also

| | | |

Related Topics