Select/Case/Case Else/EndSelect
Command
Allows the execution of multiple program sections
depending on the variable value. Executes <com-
mand set n> when <condition variable> matches
<condition value n> of any "case" command.
Executes <command set for others> ("case
else") when <condition variable> does not
match any of condition values of the "case"
commands.
This command is useful when you need to
select among multiple options based on a <con-
dition variable>.
This command is also useful to organize pro-
grams when it is used with the "call" commands
that calls subroutines.
Note A "select" is counted as nesting level 1.
Example
Block number
1 to 8
Based on the value of U(00), 100 is assigned to U(01) if U(00) is 1, and 200 is assigned to U(01) if U(00)
is 2. In the case 3, 500 is assigned to U(01) and the program jumps to the "endselect" command.
9
Jumps to the block 1: loop_ unconditionally.
Drive Programming User's Manual (I580-E2)
Description
Flowchart method
A set of "select" to "endselect" used in a subroutine is counted as nesting level 2.
Flowchart
6 Drive Programming Commands
Condition variable: a condition variable you use
Condition value n: any variable or constant
(range 128 to 127)
Command set n: one or more commands until
next "case" or "endselect" command. It can con-
tain nested commands (up to eight levels).
Format
Text language method
select <condition variable>
case <condition value 1>
<command set 1>
...
case <condition value n>
<command set n>
...
case else
<command set for others>
endselect
Operation
Argument
Text
6 - 17
6