322
6 BASIC INSTRUCTIONS
6.5 Program Branch Instructions
Note the following points when using the jump instruction.
• After the timer coil has gone ON, accurate measurements cannot be made if there is an attempt to jump the
timer of a coil that has been turned ON using the CJ, SCJ or JMP instructions.
• Scan time is shortened if the CJ, SCJ or JMP instruction is used to force a jump to the OUT instruction.
• Scan time is shortened if the CJ, SCJ or JMP instruction is used to force a jump to the rear.
• The CJ, SCJ, and JMP instructions can be used to jump to a step prior to the step currently being executed.
However, it is necessary to consider methods to get out of the loop so that the watchdog timer does not time
out in the process.
• The device to which a jump has been made with the CJ, SCJ or JMP does not change.
• The label (P*) occupies step 1.
• The jump instructions can be used only for pointer numbers within the same program file.
• If a jump is made to a pointer number inside the skip range during a skip operation, program execution will
be taken up following the pointer number of the jump destination.
• In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and an error code is stored into SD0.
Error
code
Error details Q00J/
Q00/
Q01
QnH QnPH QnPRH QnU LCPU
4210 There is no specified pointer number before the END instruction.
A pointer number which is not in use as a label in the same program has
been specified.
A common pointer in another program is specified.
P8
P9
Y42
X6
X3
P8
CJ
X7
P9
CJ
Y40
X0
When X3 is
ON, the loop
is closed.
Exits the loop when
X7 is turned ON.
18
Y4C
X9
XB
Jumps to label P19
when XB turns ON.
Y43 and Y49 remain
unchanged regardless
of whether XB and XC are
turned ON/OFF during the
execution of CJ instruction.
16
14
10
P19
P19
CJ
Y49
XB
Y43
XC
18
Y39
M36
X8
16
14
10
P9
P9CJ
Y36
M3
Y30
M33
21
Y3B
X9
Occupies 1 step