Create and fill an array in simulink

Hello,
I've got a question about Simulink. I got a signal in Simulink which changes every 1 ms.
Now, while the simulation is running, I want to save this signal every 1 ms for 10 ms when a trigger arrives. So afterwards there should be an array filled with 10 values.
I dont want to use a vector in the workspace, because I will eventually compile this simulink-model to a Electronic Control Unit through DSpace TargetLink. That's the reason why I want to have everything done in Simulink.
Anyone knows a method/ or block for simulink which can do this datalogging functionality?
Thanks for your help in advance

 Respuesta aceptada

TAB
TAB el 11 de Abr. de 2012

1 voto

Try usign Discrete/Tapped Delay block. It outputs all the collected samples.

4 comentarios

MrX
MrX el 11 de Abr. de 2012
Thank you for your answer, this method is working but how can I hold this vector now. The simulation should stop taking values after 10 ms but tapped delay (10 value windows) will move on.
Kaustubha Govind
Kaustubha Govind el 11 de Abr. de 2012
You can put the Tapped Delay block inside an Enabled Subsystem, and generate a control signal that will enable the subsystem for only 10ms.
TAB
TAB el 12 de Abr. de 2012
Agree with Govind's solution.
Use "Enabled Subsystem" and enable the logging for 10ms using a control signal.
Swati Poduval
Swati Poduval el 20 de Mayo de 2020
Hello
I know this is a reallly old link, but I dont see any new related question.
I wanted to know if there a way to give the "Number of delays" externally in the tapped delay function.
My idea is, the user should be able to connect an input port and this port gives the number of delays that the tapped function needs to have. So as to make it dynamic and not static where I set the number of delays during development phase itself.
Thanks

Iniciar sesión para comentar.

Más respuestas (2)

Umut SEN
Umut SEN el 2 de Feb. de 2018

2 votos

Hi!
I came accross this page while i was looking for a solution for more or less the same problem as you did.
I need to store data in Simulink and I cannot use matlab function block or tapped delay block because of some model standards.
Is there any other way I can store data in an array for processing?
Thanks in advance,
Umut
viyils Sangregorio
viyils Sangregorio el 27 de Oct. de 2021

0 votos

Iam coming here with the same question....Until 2021 do we have any solution for that ?

Categorías

Más información sobre Schedule Model Components en Centro de ayuda y File Exchange.

Preguntada:

MrX
el 11 de Abr. de 2012

Respondida:

el 27 de Oct. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by