3 instructions (overview), 4 assignment operator, Instructions (overview) – Lenze DDS v2.3 User Manual
Page 43: Assignment operator, Drive plc developer studio, Programming languages

Drive PLC Developer Studio
Programming languages
4-5
l
DDS EN 2.3
4.3.3
Instructions (overview)
The following instructions are available in ST:
Instruction type
Example
Assignment by assignment operator
A:=B;
CV:=CV + 1;
C:=SIN(X);
Function block call
use of the FB output
CMD_TMR(IN:=%IX1.0.1, PT:=T#300ms);
A:=CMD_TMR.Q
RETURN
RETURN
;
IF
condition
D:=B*B;
IF
D<0.0 THEN
C:=A;
ELSIF
D=0.0 THEN
C:=B;
ELSE
C:=D;
END_IF
;
CASE
s election
CASE
INT1 OF
1: BOOL1:=TRUE;
2: BOOL2:=TRUE;
ELSE
BOOL1:=FALSE;
BOOL2:=FALSE;
END_CASE
;
FOR
loop
J:=101;
FOR
I:=1 TO 100 BY 2 DO
IF ARR[I]=70 THEN
J:=I;
EXIT;
END_IF;
END_FOR
;
WHILE
loop
J:=1;
WHILE
J<=100 AND ARR[J]<>70 DO
J:=J+2;
END_WHILE
;
REPEAT
loop
J:=-1;
REPEAT
J:=J+2;
UNTIL
J= 101 OR ARR[J]=70
END_REPEAT
;
EXIT
EXIT
;
Dummy instruction
;
4.3.4
Assignment operator
The value of the expression on the right-hand side of an assignment is assigned to an operand
(variable, address) on the left-hand side of an assignment by using the assignment operator :=.
Example:
Var1 := Var2 * 10;
After this line has been executed Var1 is ten times the value of Var2.
Show/Hide Bookmarks