Borrar filtros
Borrar filtros

Simulink "To Workspace" block only outputs last part of simulation

21 visualizaciones (últimos 30 días)
Courtney
Courtney el 22 de Jun. de 2016
Editada: Nihar Deodhar el 28 de Jun. de 2016
I am using a "To Workspace" block in my Simulink diagram to send both time and angular position that is read from an encoder. When the simulation is stopped I only have the last few seconds of data for each variable in the workspace (although the length of all array variables are equal). My Simulink model is in external mode but it is not an issue with any of the hardware as many of my other Simulink models properly read in the entire simulation time and angle. Here is a screenshot with one of the parameters pulled up. All of the orange To Workspace blocks have the same parameter settings and the same issue.

Respuestas (1)

Nihar Deodhar
Nihar Deodhar el 28 de Jun. de 2016
In order to limit/remove limit on the number of points you could tweak the model configuration parameters in simulations tab of the menu bar. A snapshot is attached for more details. Either uncheck or manually enter the number of points you wish to log.
  2 comentarios
Courtney
Courtney el 28 de Jun. de 2016
Originally I did not even check the box so it shouldn't have been limiting the data points at all. When I do check the box and limit it to 1000, it is not affected (4000 or so points are still logged, but not the whole thing). Increasing the number also has no affect. I realized that it is starting over whenever my trajectory changes direction. So I am reading in an angle from an encoder and whenever the angular velocity switches from positive to negative (and vice versa) is when all data is overwritten.
Nihar Deodhar
Nihar Deodhar el 28 de Jun. de 2016
Editada: Nihar Deodhar el 28 de Jun. de 2016
I see that you are saving Time as well to the workspace. I am not sure if the time block is limiting the data sent to the work space. But one thing you could try to do is save 'structure with time' instead of saving it as an array. I am not sure if that is causing the issue though. I would be happy to look at the model if its possible for you to upload it here.

Iniciar sesión para comentar.

Categorías

Más información sobre Event Functions 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!

Translated by