Access current simulation time in SimEvents blocks

3 visualizaciones (últimos 30 días)
Alexander Poets
Alexander Poets el 29 de Jun. de 2016
Comentada: Abdolkarim Mohammadi el 22 de Mzo. de 2021
I'd like to access the current simulation time in a SimEvents block like the Entity Server to set attributes accordingly. The use case is to obtain the elapsed time an entity stayed in the Entity Queue in order to set an entity's waiting time attribute. Do SimEvents blocks provide a way to get the current simtime as a parameter without having to specify a Discrete-Event System? Thanks in advance, I appreciate any help you can provide!!

Respuesta aceptada

Devdatt Lad
Devdatt Lad el 13 de Jul. de 2016
You can create a Simulink Function t = getTime() which contains a Digital Clock block and then call this function from any event action from a SimEvents block to get the current time.
  2 comentarios
Alexander Poets
Alexander Poets el 14 de Jul. de 2016
That worked for me, thank you very much!
Abdolkarim Mohammadi
Abdolkarim Mohammadi el 22 de Mzo. de 2021
Please notice that the sample time of the Digital Clock must be set to inherited (-1).

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Discrete-Event Simulation en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by