Operation

The IAR visualSTATE project models an elevator with four floors (1-4). The elevator reacts to IAR visualSTATE events generated by pushing buttons on the board, and the elevator signals its current state via LEDs that are activated by IAR visualSTATE action function calls.

The elevator reacts to the following events:

E_requested_floor:
This event is generated each time the user of the elevator presses button BP1 for requesting a new floor. To request floor 1, the user must press button BP1 once. To request floor 2, the user must press button BP1 twice, etc. If the user presses button BP1 more than four times, the number of the requested floor wraps. The user must make his request within approximately two seconds.
E_Timeout:
This event is generated by a timer that is started the first time the user generates event E_requested_floor. The timeout is approximately two seconds. When the timeout occurs and the event is generated, the elevator starts to move to the requested floor.
E_new_floor:
This event is generated each time the elevator reaches a new floor. As this model is not a real elevator, the event must be simulated by the user by pressing button BP4 for reaching a new floor.

The elevator uses LEDs to show its current state:

To move the elevator to a specific floor, press button BP1 until LEDs DS3-DS4 indicate the requested floor. Now wait for the timeout to occur. When the timeout occurs (and if the requested floor is different from the current floor), either LED DS1 or DS2 will turn on, indicating that the elevator is now moving. The user must simulate the event that the elevator reaches a new floor by pressing button BP4 repeatedly until LEDs DS3-DS4 indicate the requested floor, and LED DS1 and DS2 are turned off indicating that the elevator is no longer moving.