modecharts
Declare mode charts that include operating modes and transitions
Syntax
modecharts mc1 = modechart ... end end
Description
modecharts
begins a mode charts declaration
block, which is terminated by an end
keyword. modecharts
is
a top-level section in a component file. It can contain one or more modechart
constructs.
Each modechart
construct declares one mode chart.
A mode chart declaration must describe a complete set of operating
modes and transition rules between these modes.
For example, the following syntax declares two mode charts, mc1
and mc2
.
modecharts (ExternalAccess = observe) mc1 = modechart ... end mc2 = modechart ... end end
modechart
is a named construct. It is terminated
by an end
keyword. A modechart
construct
contains a complete textual representation of the mode chart: modes,
transitions, and an optional initial mode specification. If you omit
the initial mode specification, then the first mode listed in the modes
section
is active at the start of simulation.
modecharts (ExternalAccess = observe) mc1 = modechart modes ... end transitions ... end initial ... end end end
A mode chart is defined within the scope of its parent component. In other words, its equations and predicates reference the component members, such as parameters and variables.
Member Accessibility Attribute Values
A modecharts
declaration block has the following
attributes:
Access
— Defines the read and write access.ExternalAccess
— Sets the visibility in the user interface.
A mode chart cannot be modifiable in the user interface. Therefore, the following rules apply:
A
modecharts
declaration block can have itsExternalAccess
attribute set toobserve
ornone
, but not tomodify
.The default
Access
attribute value ispublic
, and the corresponding default value for theExternalAccess
attribute ismodify
. Therefore, if you do not set theAccess
attribute for amodecharts
declaration block, you must explicitly set itsExternalAccess
attribute toobserve
ornone
. For example:modecharts (ExternalAccess = observe) ... end
If you set the
Access
attribute toprivate
orprotected
, then the default value for theExternalAccess
attribute isobserve
. Therefore, you do not have to set theExternalAccess
attribute value explicitly, for example:modecharts (Access = protected) ... end
Set the
ExternalAccess
attribute tonone
if you do not want the mode chart to be visible anywhere outside the language. For example:modecharts (Access = private,ExternalAccess = none) ... end