Scope an event output from stateflow chart

11 visualizzazioni (ultimi 30 giorni)
Marcello Ranucci
Marcello Ranucci il 10 Apr 2025
Modificato: Altaïr il 14 Apr 2025
Hi,
Is there a simple way to visualize in a scope an output event from a stateflow chart? I'm realizing a scheduler and I want to see if all triggers are generated correctly. Thank you very much!
Marcello

Risposte (1)

Altaïr
Altaïr il 14 Apr 2025
Modificato: Altaïr il 14 Apr 2025
A Stateflow output event has a property called Trigger, which can be configured as follows:
  • To specify an edge-triggered output event, set the Trigger property to Either Edge.
  • To specify a function-call output event, set the Trigger property to Function call.
More details can be found here:
When the Trigger is set to Either Edge, a Scope block can be used to view the event, or the event signal can be logged to the Simulink Data Inspector. For logging a Function call event, connect a Function-Call Subsystem to the event output port and enable the "Show output port" option in the block parameter of the Trigger Port block inside the subsystem.
The Trigger Port block outputs values as follows:
  • 1 for a signal that causes a rising trigger
  • -1 for a signal that causes a falling trigger
  • 2 for a function-call trigger
  • 0 otherwise
Use Markers in the plot for better visualization of the triggers. For more information, refer to the following MATLAB Answer query:
Additionally, the Sequence Viewer can be used to visualize message transition events and the data carried by the messages. Further details are available here:

Categorie

Scopri di più su Simulink Functions in Help Center e File Exchange

Prodotti


Release

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by