How do I decimate or limit data points when live-streaming signals from Speedgoat hardware to Simulation Data Inspector (SDI) with Simulink Real-Time?

7 ビュー (過去 30 日間)

My goal is to run long-term experiments on my Speedgoat real-time target for several days, and monitor signals in Simulation Data Inspector (SDI) on my host compiler continuously. However, I need to limit the data points so SDI doesn't run out of memory. How can I achieve this for my Simulink Real-Time application?

採用された回答

MathWorks Support Team
MathWorks Support Team 2025 年 4 月 23 日

For badged signals in your model:

For signals that are marked for logging in your model, right-click the signal logging badge (= blue WiFi symbol) and select "Properties". You can use the following Instrumentation Properties with Simulink Real-Time:
  • 'Decimate data' (R2021b+)
  • 'Limit data points to last' (R2021b+)
  • 'Logging sample time'
For example, you can use the "Decimate data" field to specify a decimation factor greater than one; a factor of 2 logs every other data point, effectively halving the sample rate and reducing the number of logged points. The "Limit data points to last" option captures only the last n data points, functioning like a ring buffer to retain the most recent data.
NOTE: The model-wide settings in the "Data Import/Export" pane —"Decimation" and "Limit data points to last" (LimitDataPoints/MaxDataPoints)— as well as the Override Signals feature ("Configure Signals to Log"/DataLoggingOverride), are NOT supported with Simulink Real-Time:

For instrument objects:

For signals that are streamed to SDI via instruments objects, only decimation is supported. The 'Decimation' value is set using the instrument's "addSignal" method, for example: 
>> inst = slrealtime.Instrument; >> inst.addSignal('mysignal', 'Decimation', 2);
Instruments are very flexible and allow selecting/delecting signals for live streaming during runtime. You can get an overview here: How can I stream signals from Speedgoat hardware to SDI using Simulink Real-Time R2020b and beyond?

Further tips:

(1) Refer to the following source for tips on achieving smooth live streaming performance with SDI, which is particularly important for long-term simulation. For example, SDI has settings to limit the amount of memory used: How can I improve the live streaming performance of SDI when using Simulink Real-Time and Speedgoat?
(2) Note that if MATLAB closes unexpectedly, or the host computer shuts down, the data from SDI will be lost. If reliability and avoiding data loss is a priority, consider File Logging to the local Speedgoat SSD, which can be enabled in addition to live streaming. File Logging supports decimation, but no limit data points. See the following source for an overview: File Logging Basics: Using File Log blocks to log signal data on a Speedgoat target with Simulink Real-Time R2020b and later

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeReal-Time Application Instruments についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by