Assignment operator, L-force | plc designer – Lenze PLC Designer PLC Designer (R3-1) User Manual

Page 761

Advertising
background image

L-force | PLC Designer

General Editors

DMS 4.1 EN 03/2011 TD29

759

Instruction type

Example

FOR

J:=101;
FOR I:=1 TO 100 BY 2 DO
IF ARR[I] = 70 THEN
J:=I;
EXIT;
END_IF;
END_FOR;

WHILE

J:=1;
WHILE J<= 100 AND ARR[J] <> 70 DO
J:=J+2;
END_WHILE;

REPEAT

J:=-1;
REPEAT
J:=J+2;
UNTIL J= 101 OR ARR[J] = 70
END_REPEAT;

EXIT

EXIT;

CONTINUE

CONTINUE;

JMP

label: i:=i+1;
JMP label;

Empty instruction

;

Assignment operator
On the left side of an assignment there is an operand (variable, address) to which he
value of the expression on the right side is assigned by the assignment operator :=
See also the MOVE operator which does the same.
Example:

Var1 := Var2 * 10;

After completion of this line Var1 has the tenfold value of Var2.

Notice the following features which are new in comparison to »PLC Designer« V2.3:
Further assignment operators, which are not part of the 61131-3 standard (ExST):
Set operator 'S=': The value will be "set", that is if once set to TRUE will remain TRUE.
Example:

a

S=

b;

a gets the value of b; if once set to TRUE it will remain true, even if b gets FALSE again.

Advertising