Instruction Manual

240 Language Reference Reference
Publication 1398-PM601A-EN-P October 2000
WORDS
Example
01 = ON
02 = OFF
O3 = F1
04 = ON, T = 0.1 ;turn on output 4 for 100 mS
05 = OFF, T = 3.2 ;turn off output 5 for 3.2 S
ON variable
JUMP
Case Statement Program Structure
Purpose Jump to one of a list of labels based on the value of variable. The variable acts as a
pointer into the list of labels. Labels are zero-based, so if variable = 0, the program
jumps to the first label. If variable = 3, it jumps to the fourth label and so on. If the
value of variable is greater or equal to the number of labels in the list, execution falls
through to the next instruction after the ON variable JUMP instruction.
Syntax ON Va ri able JUMP label1, label2, label3, ..., labeln
variable The variable may be a nonvolatile variable Gn, a volatile variable
Vn, or a system variable.
labeln labeln is any valid label in the program. n = 1, 2, ...
Remarks This instruction is similar to the case instruction in many other programming lan-
guages.
See Also JUMP, LABEL
Example
ON V1 JUMP LABEL1, LABEL2, LABEL3
ON G10 JUMP MODE1, MODE2, MODE3
ON V1 JMP START, LOAD, INDEX, ABORTMOVE, GO