Real-Time Windows Target |
 |
Running a Real-Time Application
You run your real-time application to observe the behavior of your model in real time with the generated code.
The process of connecting consists of
- Establishing a connection between your Simulink model and the kernel to allow exchange of commands, parameters, and logged data.
- Running the application in real time.
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:
- From the Simulation menu, click External, and then click Connect to target. Also, you can connect to the target from the toolbar by clicking
.
- MATLAB displays the message
- In the Simulation window, and from the Simulation menu, click Start real-time code. Also, you can start the execution from the toolbar by clicking
.
- Simulink runs the execution and plots the signal data in the Scope window.
In this example, the Scope window displays 1000 samples in 1 second, increases the time offset, and then displays the samples for the next 1 second.
Note
Transfer of data is less critical than calculating the signal outputs at the selected sample interval. Therefore, data transfer runs at a lower priority in the remaining CPU time after real-time application computations are performed while waiting for another interrupt to trigger the next real-time application update. The result may be a loss of data points displayed in the Scope window.
|
- Do one of the following:
- Let the execution run until it reaches the stop time.
- From the Simulation menu, click Stop real-time code.
- The real-time application stops, and MATLAB displays the message
| Entering Additional Scope Parameters for Signal Tracing | | Running a Real-Time Application from the MATLAB Command Line |  |