before
Execute chart before event broadcast or specified time
Description
before(
returns
n
,E
)true
if the event E
has occurred fewer than
n
times since the associated state became active. Otherwise, the
operator returns false
.
before(
returns
n
,tick
)true
if the chart has woken up fewer than n
times
since the associated state became active. Otherwise, the operator returns
false
.
The implicit event tick
is not supported when a Stateflow® chart in a Simulink® model has input events.
before(
returns n
,time_unit
)true
if fewer than n
units of time have
elapsed since the associated state became active. Otherwise, the operator returns
false
.
Specify time_unit
as seconds (sec
), milliseconds
(msec
), or microseconds (usec
). If you specify
n
as an expression, the chart adjusts the temporal delay as the
expression changes value during the simulation.
Note
The temporal logic operator before
is supported only in Stateflow charts in Simulink models.
Examples
Tips
You can use quotation marks to enclose the keywords
'tick'
,'sec'
,'msec'
, and'usec'
. For example,before(5,'tick')
is equivalent tobefore(5,tick)
.The Stateflow chart resets the counter used by the
before
operator each time the associated state reactivates.
Version History
Introduced in R2014b