Extensions of the IEC 61131-3 standard
The enumeration components can also be used as constant variables with the identifier
<enumeration name>.<component name>
. Enumeration components are recognized globally in the project and access to them
is unique. Therefore, a component name can be used in different enumerations.
Example
Component blue
PROGRAM PLC_PRG VAR cbFlower : COLOR_BASIC; colorCar : COLOR; END_VAR (* unambiguous identifiers although the component names are identical *) cbFlower := COLOR_BASIC.blue; colorCar := COLOR.blue; (* invalid code *) cbFlower := blue; colorCar := blue;
For more information, see: ⮫ “Operator: Enumeration Namespace ”.