ENUM with explicit values - Manual - PLCopen XML - A command line tool to import PLCopen XML files as ST code. - PLCopen XML,tool

PLCopen XML CLI Tool (plcopen-xml)

Portfolio
SIMATIC AX
Product
PLCopen XML
Software version
1.0.8
Edition
05/2024
Language
English (original)
Package Name
@ax/plcopen-xml

Structured text makes a clear distinction between an Enumeration and a Data type with named values.
If the values hold a particular significance for your software, convert the enumeration to a type with named values by defining the base type. Otherwise, simply remove the values to obtain a strongly typed enumeration.

For example the enumeration with explicit values ...

Direction : (
    Forward := 0,
    Backward := 1,
    Both := 2
);

... can be converted to a Data type with named values ...

Direction : INT (
    Forward := 0,
    Backward := 1,
    Both := 2
);

... or to a strongly typed Enumeration without values ...

Direction : (
    Forward,
    Backward,
    Both
);