Chapter 5 Instruction Words
5 - 10
until loop statement Instruction to conditionally execute a post-conditioned loop
- Format
Format Description
until <condition>
<instruction set>
loop
This instruction executes <instruction set> until <condition> is met.
Note that <condition> is checked after the execution of <instruction
set>.
- Explanation
This instruction executes <instruction set> repeatedly until <condition> is met. Note that <condition> is
checked after the execution of <instruction set>.
Execute <instruction set>
Is <condition> met?
Yes
No
- Sample program (Condition "X (00) = 0" is met after the loop is executed three times.)
Sequence of execution
until X(00) = 1 :(1) (5) (9)
Y(00) = 1 :(2) (6) (10)
Y(00) = 0 :(3) (7) (11)
loop :(4) (8) (12)
Y(00) = 1 : (13)
select case syntax statement Instruction to branch under multiple conditions
- Format
Format Description
select <conditional variable>
case <conditional value 1>
<instruction set 1>
case <conditional value 2>
<instruction set 2>
・・・
[case else]
[<instruction set n>]
end select
This instruction executes <instruction set 1> to <instruction set n-1>
described in a case statement when <conditional variable> matches
<conditional value 1> to <conditional value n-1> in the case statement,
respectively.
If the case else statement is described, <instruction set n> is executed
when <conditional variable> does not match any of <conditional value
1> to <conditional value n-1>.
- Explanation
This instruction executes <instruction set 1> to <instruction set n-1> described in a case statement
when <conditional variable> matches <conditional value 1> to <conditional value n-1> in the case
statement, respectively. If the case else statement is described, <instruction set n> is executed when
<conditional variable> does not match any of <conditional value 1> to <conditional value n-1>.