Panasonic GM1 User Manual page 182

Motion controller controller rtex
Hide thumbs Also See for GM1:
Table of Contents

Advertisement

7.2 Programming in Structured Text (ST)
Item
IF instruction
FOR instruction
WHILE instruction
CASE instruction
REPEAT instruction
EXIT instruction
RETURN instruction
JMP instruction
7-16
Example
Example:
bVar0R=bVar1;
Conditions are judged and subordinate instructions are executed according to the
judgment result.
Example:
IF (iVar0 = 4) THEN
iVar1 : = 5;
ELSIF (iVar0 = 7) THEN
iVar1 : = 10;
ELSE
iVar1 : = 15;
END_IF;
Subordinate instructions are executed repeatedly the specified number of times.
Example:
FOR iVar0 : = 1 TO 10 BY 1 DO
iVar1 : = iVar1 + 1;
END_FOR;
Conditions are judged and subordinate instructions are executed repeatedly as long as
the conditions are satisfied.
Example:
WHILE (iVar0 <> 0) DO
iVar1 : = iVar1 * 2;
END_WHILE;
Conditions are judged and subordinate instructions are executed according to the
judgment result.
Example:
CASE iVar0 OF
1 : iVar1 : = iVar1 / 2;
2 : iVar1 : = iVar1 / 4;
ELSE
iVar1 : = iVar1 / 8;
END_CASE;
Conditions are judged and subordinate instructions are executed repeatedly as long as
the conditions are satisfied.
Example:
REPEAT
iVar0 : = iVar0 + 1;
UNTIL
iVar0 = 100
END_REPEAT;
The EXIT instruction is used to terminate a loop within the FOR, WHILE, or REPEAT
instruction.
The RETURN instruction is used to terminate a program organization unit (POU).
Instructions within POUs following the RETURN instruction will not be executed.
The JMP instruction is used to unconditionally move control to the line indicated by the
JMP label.
Example:
WUME-GM1RTXOP-01

Advertisement

Table of Contents
loading

This manual is also suitable for:

Gm1 series

Table of Contents