ISPSoft User Manual 8.3.4 Applications of Enumerations After the enumeration and symbol are declared, they can be used in the POU. The data type of the symbol POUenum_Var0 is Enum_0. The Initial Value can be set by the member name or values. The image below shows the element name, Red. Users can use “.” to assign the member for the enumeration symbols, for instance, users can assign Enum_0.Blue to POUenum_Var0 , the symbol Enum_0, and execute the instruction MOV; the defined member or value will be the enumeration value and after the execution of MOV, the value of POUenum_Var0 will be 1.
Users can also perform numerical operations; using the instruction + and set the value to 1, POUenum_Var0 will be incremented by 1 as the example shown above. When the value of POUenum_Var0 is 1, after executing the instruction +, the value result will be 2 and its member will be Green as defined. When running and monitoring the program, the enumeration symbols will show their current defined member names. For example when the value is 1, the POUenum_Var0 will be seen as POUenum_Var0=Blue(1) as they are defined in the following image.
But if the value of the enumeration symbol is not in the defined member range, the value will be shown as it is; as the following example shows when the value is 11 but 11 is not in the defined range, POUenum_Var1=11 will be stated as the image shown below. 8-14