Troubleshoot Simulink Desktop Real-Time Delayed or Missing Scope Output
When simulating a Simulink® Desktop Real-Time™ model in Run in Kernel mode, Scope blocks update slowly or the Scope blocks fail to plot data.
What This Issue Means
Slow updates of Scope blocks or failure to plot data in Scope blocks could indicate that the real-time application sample time is near the lower threshold for the computer and I/O hardware.
Note
The sample time is set in the Fixed step size (fundamental sample
time) field in the Configuration Parameters
Solver pane. The Fixed step size field
appears only when Type is set to
Fixed-step
.
Plotting data has a lower priority than executing the application. A small sample time allows the application to run but can leave insufficient resources for plotting. If the sample time is so small that the application itself cannot run, an error message is displayed and real-time execution is terminated.
Try This Workaround
To check whether the sample time is causing the issue, select a larger sample time for your application. Change the sample time of any I/O drivers to be the same as the new application sample time or to an integer multiple of that time. Then, rebuild the model, connect to the target, and restart the real-time application.
As required, iterate this approach by changing the application sample time until scope
output appears. For example, start with a sample time of 0.01
seconds, and confirm that your system runs and plots are displayed. Then, decrease the
sample time until you can display scopes and meet your
accuracy and response time requirements.
After changing the application sample time, update the I/O driver sample time and
rebuild the application.