L-force | plc designer – Lenze PLC Designer PLC Designer (R2-x) User Manual

Page 527

Advertising
background image

L-force | PLC Designer

Data types in PLC Designer



DMS 3.2 EN 02/2011 TD29

525

Example:

TYPE TRAFFIC_SIGNAL: (Red, Yellow, Green:=10); (*The initial
value for each of the colors is red 0, yellow 1, green 10 *)

END_TYPE

TRAFFIC_SIGNAL1 : TRAFFIC_SIGNAL;

TRAFFIC_SIGNAL1:=0; (* The value of the traffic signal is
red*)

FOR i:= Red TO Green DO

i := i + 1;

END_FOR;

The same enumeration value may not be used twice within an enumeration or within
all enumerations used in the same POU.

Example:

TRAFFIC_SIGNAL: (red, yellow, green);

COLOR: (blue, white, red);

Error: red may not be used for both TRAFFIC_SIGNAL and
COLOR.

Advertising