Simulink Real-Time File scope write speed

3 views (last 30 days)
Rok Goljat
Rok Goljat on 7 Mar 2018
Answered: Saurabh on 4 Oct 2024
I am just wondering, how would I calculate the maximum speed with which I can save data with the File scope block?
Or what is the highest frequency at which I can run my model and still save X ammount of data?
Saving 40 doubles at frequency of 2kHz causes some missing data (there are no samples saved). At higher frequencies this is even worse.

Answers (1)

Saurabh
Saurabh on 4 Oct 2024
I am not sure how to calculate the maximum speed at which one can save data with the "File Scope" Block. But you can refer to the following article to know why there is missing data while logging.
So, If the buffer is too small and the model rate is too fast, the background task (which writes the memory buffer to disk) is not yet finished by the time the buffer fills up again. The Autorestart option may lead to a loss of data in such cases.
By increasing the Number of Samples, you can increase the size of the buffer, which means the buffer fills up less frequently. By increasing WriteSize, the background thread can write more data to the disk, hence it helps keep up with the data collection.
You can also switch off "Autorestart" to avoid this issue.
I hope this helps.

Categories

Find more on Simulink Real-Time in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!