Main Content

overflowed

Determine when a message queue overflows

Description

example

overflowed(message_name) checks whether a message is lost because it was sent to a queue that was already full. In each time step, the value of this operator is set when a chart adds a message to, or removes a message from, a queue. It is invalid to use the overflowed operator before sending or retrieving a message in the same time step. To use the overflowed operator, set the model to an autosar.tlc target for both simulation and code generation and verify that the inport or outport message connects to an external queue.

  • To check the overflow status of an input message queue, first remove a message from the queue.

  • To check the overflow status of an output message queue, first add a message to the queue.

  • To check the overflow status of a local message queue, first add a message to the queue or remove a message from the queue.

Examples

collapse all

Check the input or local queue for message M. If a message is present and the queue has overflowed, transition occurs.

M[overflowed(M)]

Check the input or local queue for message M. If a message is present and the queue has overflowed, increment the value of x.

on M:
if overflowed(M) == true
    x = x+1;
end

Send message and check for overflow. If the queue overflows, increment the value of x.

entry:
M.data = 3;
send(M);
if overflowed(M) == true
    x = x+1;
end

Tips

  • By default, when a message queue overflows, simulation stops with an error. To prevent a run-time error and allow the overflowed operator to dynamically react to dropped messages, set the value of the Queue Overflow Diagnostic property to Warning or None. For more information, see Queue Overflow Diagnostic (Stateflow).

Introduced in R2018b