This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

overflowed

Determine when message queue overflows

Syntax

overflowed(message_name)

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 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

expand 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.

Introduced in R2018b