| Contents | Index |
During a run, you may notice either slow updates of Scope blocks or a complete failure to plot data in Scope blocks. This could indicate that the real-time application sample time (set by Configuration Parameters > Fixed step size) is near the lower threshold for your hardware. Plotting data has a lower priority than executing the application, so a small sample time may allow the application to run but 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.
To check the appropriateness of the sample time, type rtwho, then look at the value displayed for MATLAB performance. A value less than 80% indicates that your sample time may be too small. If this occurs, select a larger sample time. If necessary, also change the sample time of any I/O drivers to be the same as the new application sample time, or an integer multiple of that time. Then rebuild the model, connect to the target, and restart the real-time application.
You may need to iterate changing the sample time until scope output appears. You must always rebuild the application after changing the sample time. In general, we recommend that you start by choosing a larger sample time, then decreasing it as needed to provide the desired responsiveness and accuracy. For example, initially select a sample time of 0.01 second, and confirm that your system runs correctly and plots are displayed.
Sample times can be too large as well as too small. After you have found an application sample time that gives acceptable Scope block display, again type rtwho and check MATLAB performance. If MATLAB performance is in the range of 98% or so, consider decreasing your sample time by one order of magnitude. After such a change, any previously correct I/O driver sample times remain correct, because they are integer multiples of the new application sample time.
![]() | Failure to Connect to Target | S-Functions Using Math Functions | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |