User`s guide
Real-Time Application
3-29
Running a Real-Time Application from the MATLAB
Command Line
You can use the MATLAB command-line interface as an alternative to using
the Simulink GUI. Enter commands directly in the MATLAB window or enter
them in an M-file.
After you build the real-time application, you can run your model in real time.
This procedure uses the Simulink model
rtwin_model.mdl as an example, and
assumes you have created a real-time application for that model:
1 In the MATLAB window, type
set_param(gcs,'SimulationMode','external')
Simulink changes to external mode.
2 Type
set_param(gcs,'SimulationCommand','connect')
MATLAB loads the real-time application, connects it to the Simulink block
diagram, and displays the message
Model rtwin_model loaded
3 Type
set_param(gcs,'SimulationCommand','start')
Simulink starts running the real-time application.
4 Type
set_param(gcs,'SimulationCommand','stop')
Simulink stops the real-time application.