!
7-15
Section
Timer and Counter Instructions
395
Program execution will continue even if a non-BCD SV is used, but the SV will
not be correct.
Flags
ER:
Indirectly addressed DM word is non-existent. (Content of
*
DM word is
not BCD, or the DM area boundary has been exceeded.)
Example
In the following example, CNT is used to create extended timers by counting SR
area clock pulse bits.
CNT 001 counts the number of times the 1-second clock pulse bit (SR 25502)
goes from OFF to ON. Here again, IR 00000 is used to control the times when
CNT is operating.
Because in this example the SV for CNT 001 is 700, the Completion Flag for
CNT 002 turns ON when 1 second x 700 times, or 11 minutes and 40 seconds
have expired. This would result in IR 20002 being turned ON.
CP
R
CNT
001
#0700
00000 25502
00001
CNT 001
20002
Address
Instruction
Operands
00000
LD
00000
00001
AND
25502
00002
LD NOT
00001
00003
CNT
001
#
0700
00004
LD
CNT
001
00005
OUT
20002
Caution
The shorter clock pulses will not necessarily produce accurate timers because
their short ON times might not be read accurately during longer cycles. In partic-
ular, the 0.02-second and 0.1-second clock pulses should not be used to create
timers with CNT instructions.
7-15-6 REVERSIBLE COUNTER – CNTR(12)
N
TC number
Ladder Symbol
Definer Values
SV
: Set value (word, BCD)
IR, SR, AR, DM, HR, LR, #
Operand Data Areas
II
DI
CNTR(12)
N
SV
R
Each TC number can be used as the definer in only one TIMER or COUNTER
instruction. TC numbers run from 000 through 255 in the CPM2A/CPM2C PCs
and from 000 through 127 in the CPM1/CPM1A/SRM1(-V2) PCs.
The CNTR(12) is a reversible, up/down circular counter, i.e., it is used to count
between zero and SV according to changes in two execution conditions, those in
the increment input (II) and those in the decrement input (DI).
The present value (PV) will be incremented by one whenever CNTR(12) is
executed with an ON execution condition for II and the last execution condition
for II was OFF. The present value (PV) will be decremented by one whenever
CNTR(12) is executed with an ON execution condition for DI and the last execu-
tion condition for DI was OFF. If OFF to ON changes have occurred in both II and
DI since the last execution, the PV will not be changed.
Precautions
Limitations
Description