Simulink Real-Time File scope write speed

2 次查看(过去 30 天)
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.

回答(1 个)

Saurabh
Saurabh 2024-10-4
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.

类别

Help CenterFile Exchange 中查找有关 Simulink Real-Time 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by