State machine timers

Timers can be only used when the state machine is asynchrounous.

A timer is a type of event, it is defined by the attribute id and name.

The id is the id of the event being triggered when the timer expired, id is referenced in the attribute transition@event .

The name is the name of the timer and is being used to start and stop the timer with the timerStart and timerStop element.

Here is how to define timers:

This code shows how to start and stop a timer, as well as handle a transition when the timer expires:

The duration in milliseconds can be obtained through one of the method of the object instance, in this case doorTester.GetOpenDuration(). There is no need to insert numerical value inside the state machine description.

timerStart and timerStop can alo be placed inside a transition element: