Skip to main content

运算符:枚举命名空间

运算符是 IEC 61131-3 标准的扩展。

您可以使用枚举的 TYPE 名称对枚举常量进行唯一访问。这样,您可以在不同的枚举中使用相同的常量名称。

枚举名称前面带有一个点 (.)。

<enumeration name>.<constant name>

163. 例子

常数 Blue 是两个枚举的组成部分 Colors 和枚举 Feelings.

color := Colors.Blue;  // Access to coomponent Blue in enumeration Colors

feeling := Feelings.Blue; // Acces to component Blue in enumeration Feelings