Real-Time Windows Target    

Sample Time Too Fast

During a run, you may not see any output in the Scope window. This could indicate that the sample time is too small. In the MATLAB command window, type

Check the value for MATLAB performance. A value less than 80% indicates that your sample time may be too small.

In general, we recommend that you start by choosing a slow sample rate. For example, select a sample time of 0.01 second, and confirm your system runs correctly and plots are displayed. Should you select a sample rate that exceeds the capability of your computer, an error message is displayed and real-time execution is terminated. If this occurs, select a slower sample rate. Then rebuild the model, connect to the target, and start the real-time application again. You must rebuild the real-time application after changing the sample time.

Check the MATLAB performance value returned when typing rtwho. If MATLAB performance is in the range of 98% or so, then consider decreasing your sample time by one order of magnitude.

If you notice either slow updates of Scope blocks or a complete failure to plot data in the Scope blocks, you may be reaching the upper threshold for the sample rate on your hardware. Plotting data has a lower priority than execution of your real-time application.


  Failure to Connect to Target S-Functions Using Math Functions