Statecharts proper value. For example, to make sure that a sensor is always read regardless of what state an object is in, create a static reaction in the superstate with the following transition: This way, no matter what substate the object is in, it will always return the proper value. Although both the trigger to the superstate and that to a substate are active when in a substate, the trigger on the transition to the superstate is taken because it is higher priority. See Transition selection . opRead/reply(getStatus()) Timeouts Timeout triggers have the syntax tm( ) , where is the number of time units. The default time unit is milliseconds.
The time units are set based on the operating system adapter implementation of the tick timer. A timeout is scheduled when the origin state ( s1 ) is entered. If the origin state has exited before the timeout was consumed, the timeout is canceled. You can use the timeouts mechanism ( tm() ) when the quality of service (QOS) accuracy requirement conforms with the following timeout accuracy. When a timeout occurs, it is inserted to the event queue related to the reactive instance. The time on which the timeout is consumed depends on the actual system state. The timeout occurrence depends on three factors: 1. The timeout request time (T) 2.
The tick-timer resolution (R) The resolution specifies how often the system checks if there are expired timeouts. 3. Timeout latency (L) The tick timer implementation for some operating system adapters is synchronous (using a call to sleep(interval) ). This means that there is a built-in latency (the time spent processing the expired timeouts). This latency can be significant when the timeout is very long (involving many timer ticks). The following formula determines when a timeout will expire: [(T+L)-R,(T+L)+R] 746 User Guide