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.

Set Properties for a Message

A message is a Stateflow® object that communicates data locally or between charts in a Simulink® model. For more information, see Communicate with Stateflow Charts by Sending Messages.

You can specify message properties in either the Property Inspector or the Model Explorer.

  • Property Inspector

    1. Open the Symbols window by selecting View > Symbols.

    2. Open the Property Inspector by selecting View > Property Inspector.

    3. In the Symbols window, select the message.

    4. In the Property Inspector window, edit the message properties.

  • Model Explorer

    1. Open the Model Explorer by selecting View > Model Explorer.

    2. In the Contents pane, double-click the message.

    3. In the Message pane, edit the message properties.

For more information, see Communicate with Stateflow Charts by Sending Messages.

Stateflow Message Properties

Name

Name of the message. For more information, see Rules for Naming Stateflow Objects.

Scope

Scope of the message. The scope specifies where the message occurs relative to the parent object.

ScopeDescription
Input from SimulinkMessage that is received from another Stateflow chart. Each input message has a receiving queue.
Output to SimulinkMessage that is sent through an output port to another Stateflow chart.
LocalMessage that is local to the Stateflow chart. A local message has a receiving queue with the same properties as an input message queue. When you send a local message, a transition or action in the same chart can evaluate the local message. You cannot send a local message outside the chart.

Port

Index of the port associated with the message. This property applies only to input and output messages.

Size

Size of the message data field. For more information, see Specify Size of Stateflow Data.

Complexity

Specifies whether the message data field accepts complex values.

Complexity SettingDescription
OffData field does not accept complex values.
OnData field accepts complex values.
InheritedData field inherits the complexity setting from a Simulink block.

The default value is Off. For more information, see Complex Data in Stateflow Charts.

Type

Type of the message data field. To specify the data type:

  • From the Type drop-down list, select a built-in type.

  • In the Type field, enter an expression that evaluates to a data type.

  • In the Model Explorer, use the Data Type Assistant to specify a data Mode, and then specify the data type based on that mode. To display the Data Type Assistant, click the Show data type assistant button . The Data Type Assistant is available only in the Model Explorer.

Messages do not support fixed-point data.

Add to Watch Window

Enables watching the message queue and data field in the Stateflow Breakpoints and Watch window. For more information, see Watch Stateflow Data Values.

Queue Capacity

For input and local messages, specifies the maximum number of messages held in the queue. If a chart sends a message when the receiving queue is full, a message overflow occurs. To avoid dropped messages, set the queue capacity high enough so incoming messages do not cause the queue to overflow. The maximum queue length is 216–1.

Queue Overflow Diagnostic

Specifies the diagnostic action when the number of incoming messages exceeds the queue capacity. The default option is Error.

Diagnostic SettingDescription
ErrorWhen the queue overflows, simulation stops with an error.
WarningWhen the queue overflows, it drops the last message and simulation continues with a warning.
NoneWhen the queue overflows, it drops the last message and simulation continues without issuing a warning.

Queue Type

Specifies the order in which messages are removed from the queue. The default option is FIFO.

Queue Type SettingDescription
FIFOFirst In, First Out
LIFOLast In, First Out
Priority

Remove messages according to value in the data field. Choose Priority order from these options:

  • Ascending. The order of the message removed is based on an ascending order of the message data value.

  • Descending. The order of the message removed is based on a descending order of the message data value.

Related Topics