send

Broadcast message or event

Description

example

send(message_name) sends a local or output message.

example

send(output_event_name) sends an output event.

example

send(local_event_name,state_name) broadcasts a local event to state_name and any offspring of that state in the hierarchy.

example

send(state_name.local_event_name) broadcasts a local event to its parent state state_name and any offspring of that state in the hierarchy.

Examples

expand all

Send a local or output message M with a data value of 3.

M.data = 3;
send(M);

Send an output event e.

send(e);

Send a local event e to state A.A1 and any of its substates.

send(e,A.A1);

Send a local event e to its parent state A and any of its substates.

send(A.e);

Tips

  • If a chart sends a message that exceeds the capacity of the receiving queue, a queue overflow occurs. The result of the queue overflow depends on the type of receiving queue.

    • When an overflow occurs in an internal queue, the Stateflow® chart drops the new message. You can control the level of diagnostic action by setting the Queue Overflow Diagnostic property for the message. See Queue Overflow Diagnostic.

    • When an overflow occurs in an external queue, the Queue block either drops the new message or overwrites the oldest message in the queue, depending on the configuration of the block. See Overwrite the oldest element if queue is full (Simulink). An overflow in an external queue always results in a warning.

Introduced in R2018b