Execute Real-Time Application in Run in Kernel Mode by Using Step by Step Commands
After you build the real-time application, you can run your model in real time. In Run in Kernel mode, you execute your real-time application to observe the behavior of your model in real time by using the generated code.
This procedure uses the model sldrtex_model
. To open this model,
in the MATLAB® Command Window, type:
openExample('sldrtex_model')
It shows how to use Step by Step Commands to complete simulation operations as individual steps.
Buttons | Step by Step Command Operations |
---|---|
Use the Run in Kernel button to select the mode for simulation. | |
Use the Build button to build the real-time application. | |
Use the Connect button to connect to the model and kernel. | |
Use the Disconnect button to disconnect the real-time application from the model and kernel. | |
Use the Start button to run the real-time simulation. | |
Use the Stop button to stop running the real-time simulation. |
Open the model
sldrtex_model
.In the Simulink® Editor, on the Desktop Real-Time tab, click Mode > Run in Kernel.
In the Simulink Editor, on the Desktop Real-Time tab, click Run in Real Time > Build.
Simulink builds the real-time application.
On the Desktop Real-Time tab, click Run in Real Time > Connect.
Simulink connects the model and kernel.
On the Desktop Real-Time tab, click Start.
Simulink starts running the simulation.
To stop the simulation before it ends, on the Desktop Real-Time tab, click Stop.
These Step by Step Commands let you run a real-time simulation for a previously built real-time application.
If continuing from the previous procedure, close the model
sldrtex_model
.Open the model
sldrtex_model
.In the Simulink Editor, on the Desktop Real-Time tab, click Mode > Run in Kernel.
On the Desktop Real-Time tab, click Run in Real Time > Connect.
Simulink connects the model and kernel.
On the Desktop Real-Time tab, click Start.
Simulink starts running the simulation.
To stop the simulation before it ends, on the Desktop Real-Time tab, click Stop.