Truncated "to workspace" data from Simulink model during external mode: only the latest data are correctly saved.
6 次查看(过去 30 天)
显示 更早的评论
Hi everyone, I'm experiencing an annoying issue when saving data from running a Simulink model in external mode. If a "to workspace" block is inserted into the model and regardless the type of data required (time series/array/structure), only a small random number between 100 and 1000 of the entire data are effectively stored in the workspace variable, corresponding to the very little end of those actually generated by the model. Data points are set to infinite in the block dialog so I can not figure out why this truncation takes place, and why the data length appears so unpredictable. For the sake of clarity, I'm working with Ubuntu 14.04 running Matlab R2014b and Simulink is used in external mode with a fixed sample time. Many thanks to all those will help me.
0 个评论
采纳的回答
Vidya Viswanathan
2016-4-1
Hi Alberto,
Could you clarify if you are trying to run the model in Arduino? What is the sample time used? Typically, the gap in output data is observed when the sample rate is less than 10ms because the target tries to upload the data to the host every few seconds.
To resolve the issue,
1) Please increase the duration further in your model and see if it satisfies your requirements. Ideally, it is not recommended to run external mode on Arduino targets at very high rates (such as 1 ms).
2) If your requirement is to have data archiving at very high speeds, it is recommended to use a serial block for data upload. You would then use an ICT receive block on the Host to log data into MATLAB.
I hope this addresses your query. If this does not resolve the issue, please feel free to contact MathWorks Technical Support corresponding to your geographical location. You could reach them through the following link:
Regards,
Vidya Viswanathan
0 个评论
更多回答(2 个)
minkow38
2017-9-6
Hi Alberto,
I've faced issue in terms of logging data, I only had at best the last 1000samples that were saved to my workspace after running my simulink model in external mode.
I've found a solution in mathworks documentation:
If you change the "Duration" parameter in "External & triggering Signals" window that should help you.
0 个评论
Giorgio Concu
2017-12-6
I had the same proble withe R2015b and I fix it just upgrading to 2016b or higher.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 General Applications 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!