Truncated "to workspace" data from Simulink model during external mode: only the latest data are correctly saved.
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Alberto Favaro
el 21 de Mzo. de 2016
Respondida: Giorgio Concu
el 6 de Dic. de 2017
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 comentarios
Respuesta aceptada
Vidya Viswanathan
el 1 de Abr. de 2016
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 comentarios
Más respuestas (2)
minkow38
el 6 de Sept. de 2017
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 comentarios
Giorgio Concu
el 6 de Dic. de 2017
I had the same proble withe R2015b and I fix it just upgrading to 2016b or higher.
0 comentarios
Ver también
Categorías
Más información sobre General Applications en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!