Stream Real-Time Signals by Using Simulink Real-Time Explorer
This procedure uses the model slrt_ex_osc
and shows
how to instrument signals in Simulink Real-Time Explorer to visualize streaming signal
data.
Open model
slrt_ex_osc
. In the MATLAB® command window, typeslrt_ex_osc
.Connect to a Speedgoat® target computer. On the Simulink® Editor Real-Time tab, select a target computer and toggle the Disconnected indicator to Connected.
Build the real-time application for the target computer. Click Run on Target > Build Application.
Open Simulink Real-Time™ Explorer. Click Prepare > SLRT Explorer.
Click Load Application. Select the
slrt_ex_osc
application from the Applications on target computer list and click Load.To view the logged signals —which are processed by the File Log block in the real-time application— and the streamed signals —which are streamed by the instrument in the real-time application— in the Simulation Data Inspector, click Data Inspector.
Set the real-time application Stop time to
inf
.To start the real-time application, click Start.
To stop execution, click Stop.
Observe that the Simulation Data Inspector is updated with signal data from the File Log block after the application stops.
To select a signal to stream in the real-time application, choose the
SigGen
signal from the Signals available on target computer list , and then click Add to signals in instrument .Or, select the signals to monitor from the list, right click and select
Add To Instrument List
.Then, click Add Instrument.
Click Start and observe that the signal data appears in the Simulation Data Inspector as the application runs.
While the real-time application is running, add another signal to stream. Choose the
XfrFnc
signal from the Signals available on target computer list , and then click Add to signals in instrument . To update the instrument, click Configure Instrument.Observe that the added signal data appears in the Simulation Data Inspector as the application runs, starting at the time you updated the instrument.
You can click Remove Instrument to stop streaming signal data without stopping the real-time application.
To stop execution, click Stop.