E L C P r o g r a m m i n g M a n u a l
F o r m o r e i nf o r m a t i o n v i sit :
w w w. e a t o n . c o m
MN05003003E
3-34
3.7 Detailed Instruction Explanation
API Mnemonic
Operands
Function
00
CJ P
S
Conditional Jump
OP Range
Program
Steps
S
P0~P255
CJ, CJP: 3 steps
ELC ELCB
ELCM
PB PC/PA/PH
PV
PB PH/PA
32 16
P
32 16
P
32 16
P
32 16 P 32 16 P
Operands:
S
: The destination pointer of the conditional jump, P can be modified by Index register E, F
1.
ELC-PB, ELCB-PB have 64 pointers; available from the range of P0 to P63.
2.
ELC-PC/PA/PH/PV and ELCM-PH/PA have 256 pointers; available from the range of
P0~P255.
Description:
1.
When the CJ instruction is true it forces the program to jump to the specified program marker.
While the jump takes place the intervening program steps are skipped. This means they are
not processed in any way. The resulting effect is to speed up the program scan time.
2.
When the destination of the pointer P is before the CJ instruction, note that this is a program
loop and there must be a way out of the loop. If it continually jumps backwards, the Watchdog
timer will eventually time out faulting the processor. Loops are generally not recommended in
PLC programming. It’s always better to allow the program scan to run. The I/O is updated once
per scan and if the program is caught in a loop, the I/O is not being scanned and updated.
3.
What happens to each data type when the CJ instruction jumps over them :
a) Y, M, S remains its previous state before the condition jump occurs.
b) General
timers, accumulative timers and general counters will freeze their current values if
they are skipped by a CJ instruction.
c) Timers for Subroutines and Interrupts are an exception to this as they are processed
independently of the main program.
d) High speed counters are also an exception to this as they are processed independently of the
main program.
e) The ordinary counters stop executing.
f) If the “reset instruction” of a timer is executed before the conditional jump, the device will still
be in the reset status while jump is being executed.
g) Application instructions are also skipped if they are programmed between the CJ instruction
and the destination pointer. However, the DHSCS, DHSCR, DHSZ, SPD, PLSY, PWM, PLSR,
PLSV, DDRVI and DDRVA instructions will operate continuously if they were active before the
CJ instruction was executed, otherwise they will not be processed. .
Содержание ELC-PB
Страница 1: ......
Страница 5: ...For more information visit www eaton com MN05003003E iv...
Страница 29: ...ELC Programming Manual For more information visit www eaton com MN05003003E 1 24 MEMO...
Страница 502: ...3 Instruction Set MN05003003E For more information visit www eaton com 3 333...
Страница 601: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 432...
Страница 625: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 456...