MATLAB Answers

Simulink Real Time: Logging non-virtual bus

25 views (last 30 days)
Kelly Schultz
Kelly Schultz on 14 Nov 2018
Commented: Ayush Agrawal on 23 Aug 2019
Running on a Speedgoat here. We have a very large Simulink Real Time model (compile time is ~10 minutes), and we're not so experienced with Simulink Real Time. We are trying to log many different non-virtual bus signals, but we have not been able to do without breaking the signals apart into their respective signals and pushing that into a File Scope. And that is still not preferable because we only have 8 (including Target scopes....).
I was looking into the Simulation Data Inspector. I was able to get some data back into the target computer, but not a lot (I think like 1 second in total), and nothing in the non-virtual buses was recorded. I'm going to guess that File Scopes are simply the best option we have here, but it's annoying that we can't feed a bus signal into one directly.
What am I doing wrong here?
Note:
We are integrating lots of other people's Simulink work here. We are mostly locked into the overall structure of this model.

  0 Comments

Sign in to comment.

Answers (1)

Jon Lobo
Jon Lobo on 14 Dec 2018
Hi Kelly,
Non-virtual buses should work when you select them for logging to the Simulation Data Inspector. I suspect that you currently have them configured for "Immediate" logging which streams data from the Speedgoat target to the host.
If you right click on the data logging icon (above the signal), and select properties you should see a window that has a pane for Simulink Real-Time as in the example linked below. Try using "Buffered" mode. In this mode, the data is logged to disk on the target. The data is then transferred to the host when the execution on the target stops.

  3 Comments

Kelly Schultz
Kelly Schultz on 14 Dec 2018
That does indeed work, and I have tried what you have said.
However, I noticed that all of the data logged by the Simulation Data Inspector gets logged to one file in a rundir folder on the target, which has the FAT 4 GB limit. Is there a way to get the Simulation Data Inspector to use dynamic file naming, like how the File Scopes can?
Kelly Schultz
Kelly Schultz on 14 Dec 2018
I ran a test where we were expecting to log ~12 GB of data using the SImulation Data Inspector with the Buffered option set. I watched the file size of the logged file by the Simulation Data Inspector reach 4 GB, and then stop.
Ayush Agrawal
Ayush Agrawal on 23 Aug 2019
Is it possible to specify the file name (similar to file scopes) for the log data using this method? My current setup requires booting up and running the target application through a USB drive and I generally copy the .dat files (stored through file scopes) after the end of an excution of the target application. However, I am now considering using buses since I have a bunch of signals that I'd like to log. This seems like a feasible option but I'm unsure on how to use it.

Sign in to comment.


Translated by