Why are my logged signals recorded via live streaming shorter than expected when my model is run on the Speedgoat target machine with Simulink Real-Time (SLRT)?

1 view (last 30 days)
I have a model where I am logging several signals using signal logging badges and the Simulation Data Inspector (SDI). When I run the model in Simulink on the host machine, the logged signals have the expected number of time points. When I run the model on the Speedgoat target machine with Simulink Real-Time (SLRT), the signals have fewer time points than expected, and the length varies a little bit with each run.
Why is this happening, and how can I capture the full length of my signals in the logs?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 8 Nov 2023
Edited: MathWorks Support Team on 8 Nov 2023
Live streaming from a real-time application does not guarantee all the data appears in the Simulation Data Inspector (SDI). Live stream instrumentation runs at a lower priority than the real-time application. So, data sent by live streaming could be dropped if the host-target connection cannot keep up. This behavior is documented in Troubleshoot Gaps in Streamed Data.
Please refer to the following official MATLAB Answers post for information on how to improve the performance of live streaming in Simulink Real-Time: https://www.mathworks.com/matlabcentral/answers/882723-how-can-i-improve-the-signal-streaming-performance-of-simulation-data-inspector-sdi-when-using-sim
As discussed in that article, the most robust method of signal logging is to use 'File Log' blocks. Each 'File Log' block logs the signal connected to it to the target computer’s filesystem. After the simulation finishes, the logged data is automatically imported into the SDI on the host computer. Because the data is not streamed live to the host computer, this avoids the problems caused by resource limitations on the target computer.
Please refer to the following documentation links for further information about Simulink Real-Time signal logging and the 'File Log' block: 

More Answers (0)

Community Treasure Hunt

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

Start Hunting!