Пример программы

PROGRAM PLC_PRG
VAR
    in1: SINT;
    in2: USINT;
    in3: INT;
    in4: UINT;
    in5: DINT;
    in6: UDINT;
    in7: REAL;
    in8: LREAL;
    in9: BOOL;
    in10: INT := 1;

    out: REAL;

    in: REAL;
    I: INT;

    portin1 AT %DIN1: BOOL;
    portin2 AT %DIN2: BOOL;
    portout AT %DOUT1: BOOL;
END_VAR
VAR_INPUT
    in11: BOOL;
END_VAR
VAR_OUTPUT
    in12: BOOL;
END_VAR
VAR_IN_OUT
    in13: BOOL;
    in14: BOOL;
END_VAR
VAR_EXTERNAL
    in15: BOOL;
    in16: BOOL;
END_VAR
VAR_GLOBAL
    in17: BOOL;
    in18: BOOL;
END_VAR
VAR_ACCESS
    in19: BOOL;
END_VAR

WHILE out < 100 DO
    out:= 0;
    out:= 1;
    out:= 2 + in;
END_WHILE;

REPEAT
    out := out + 1;
UNTIL in = 101
END_REPEAT;

FOR I := 1 TO 100 BY 2 DO
    out := out + 2;
END_FOR;

FOR I := 100 TO 1000 DO
    out := out + 10;
END_FOR;

out := 1 + in1 + 2 + in2 + 3;
out := in1 < in2 <= in3 = in4 <> in5 >= in6 > in7;
out := in1 AND NOT in2;
out := in1 OR in2;
out := in1 OR in2 OR in3;
out := in1 OR in2 OR in3 OR in4;
out := in1 OR in2 XOR in3 AND in4 + in5 * in6  - in7 / in8;
out := (in1 + in2) / (in3 * (in4 - in5));
out := in1 + SHL(in2, 2) * in3;
out := SHL(in1, 3);

IF in1 > 100 THEN
    out:= 1;
ELSE
    out:= 0;
    out:= 2;
END_IF;

out := LN(in);
out := EXP(in);
out := SIN(in);
out := ASIN(in);
out := COS(in);
out := ACOS(in);
out := TAN(in);
out := ATAN(in);

END_PROGRAM