EasyManua.ls Logo

Panasonic GM1 - Page 182

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

Table of Contents

Related product manuals