FX Series Programmable Controlers Applied Instructions 5
5-5
5.1.1 CJ (FNC 00)
Mnemonic Function
Operands
Program steps
D
CJ
FNC 00
(Conditional
Jump)
Jumps to the
identified pointer
position
Valid pointers from the ran
g
e 0 to 63
CJ,
CJP:3steps
Jump pointer
P
PP
: 1 step
P9 CJ
P9
X20
[ D ]
X21
P 9
P 9CJ
P9
X20
CJ
X1
P 0CJ
P0
X0
M8000
Y1
Y0
END
Operation:
When the CJ instruction is active it forces the pro
g
ram
to
j
ump to an identified pro
g
ram marker. While the
j
ump takes place the intervenin
g
pro-
g
ram steps are
skipped. This means the
y
are not processed in an
y
wa
y
. The resultin
g
effect is to speed up the pro
g
rams
operational scan time.
Points to note:
a) Man
y
CJ statements can reference a sin
g
le pointer.
b) Each pointer must have a unique number. Usin
g
pointer P63 is equivalent to
j
umpin
g
to the END
instruction.
c) An
y
pro
g
ram area which is skipped, will not update
output statuses even if the input devices chan
g
e.
For example, the pro
g
ram opposite shows a
situation which loads X1 to drive Y1. Assumin
g
X1
is ON and the CJ instruction is activated the load
X1, out Y1 is skipped. Now even if X1 is turned
OFF Y1 will remain ON while the CJ instruction
forces the pro
g
ram to skip to the pointer P0. The
reverse situation will also appl
y
, i.e. if X1 is OFF to
be
g
in with and the CJ instruction is driven, Y1 will
not be turned ON if X1 is turned ON. Once the CJ
instruction is deactivated X1 will drive Y1 in the
normal manner. This situation applies to all t
y
pes of
outputs, e.
g
. SET, RST, OUT, Y, M and S devices
d) The CJ instruction can
j
ump to an
y
point within the main pro
g
ram bod
y
or after an FEND
instruction