Execute Real-Time Application with MATLAB Language
Run the real-time application by
using generated code to observe the real-time behavior of the model. This procedure uses
the Simulink® model slrt_ex_osc_rt
. To open the example model, in the
MATLAB® Command Window, type:
openExample('slrealtime/SlrtCreateAndRunRealTimeAppFromSimulinkModelExample', ... 'supportingFile','slrt_ex_osc_rt.slx')
You must have already completed the steps in Prepare Real-Time Application by Using MATLAB Language. In the model, select the output signal and mark the signal for data logging with the Simulation Data Inspector.
This example uses functions in the MATLAB Command Window to start and stop the real-time
application. For more information,
see Target
object
functions.
Start the target computer.
The target computer displays session 1 (default) and the target computer status monitor.
Open the Simulation Data Inspector. In the MATLAB Command Window, type:
Simulink.sdi.view
Start the real-time application. In the MATLAB Command Window, type:
start(tg)
Observe that the real-time application starts running on the target computer. The status monitor displays information as the real-time application executes. The Simulation Data Inspector displays signal data.
Stop the real-time application. In the Command Window, type:
stop(tg)
To observe the event status of the
Target
object, install a listener for object events.
To view the status monitor from the development computer, you can use PuTTY to open an
SSH client and start the status monitor application
/usr/target/bin/statusmonitor
on the target computer.
For more information, see Target Computer Status Monitor.