1 Lamp
This "UML state diagram" sample illustrates the basic functionality of the UML state diagram and contains the following UML SC elements:
Sample project: TF1910_UmlSC_Sample1_Lamp.zip
Overview
UML SC is used to program the behavior of a lamp, which can be switched on and off via a switch on the visualization. The lamp has two states, "On" and "Off".
Each state contains one ENTRY action and one DO action.
- The lamp is switched on or off in the ENTRY actions. The ENTRY action is called once whenever the corresponding state is activated.
- An ON or OFF counter is incremented in the DO actions. This indicates that a DO action is called permanently as long as the corresponding state is active.
- The value of the switch is requested as a transition between the states.
Visualization
In addition to the convenient online mode of the UML SC diagram, the behavior of the lamp and the values of the counters can be followed via the visualization.