251
3. Instructions
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Timer and Counter Instructions
3
CNR/CNRX
Precautions
• The timer/counter that is reset is as follows.
• The CNR(545)/CNRX(547) instructions do not reset TIML(542), TIMLX(553), MTIM(543), and
MTIMX(554), because these timers do not use timer numbers.
• The CNR(545)/CNRX(547) instructions do not reset the timer/counter instructions themselves, they
reset the PVs and Completion Flags allocated to those instructions. In most cases, the effect of
CNR(545)/CNRX(547) is different from directly resetting the instructions. For example, when a
TIM/TIMX(550) instruction is reset directly its PV is set to the SV, but when that timer is reset by
CNR(545)/CNRX(547) its PV is set to the maximum value (9999 for BCD and FFFF for binary).
• When N1 and N2 are specified with N1>N2, only the Completion Flag for the timer/counter number
will be reset.
Example Programming
T
Instructions reset Operation of CNR(545)
BCD TIM: HUNDRED-MS TIMER
TIMH(015): TEN-MS TIMER
TMHH(540): ONE-MS TIMER
TTIM(087): ACCUMULATIVE TIMER
TIMW(813): HUNDRED-MS TIMER WAIT
TMHW(815): TEN-MS TIMER WAIT
CNT: COUNTER
CNTR(012): REVERSIBLE COUNTER
CNTW(814): COUNTER WAIT
The PV is set to its maximum value (9,999 BCD) and
the Completion Flag is turned OFF.
TIMU(541): TENTH-MS TIMER
TMUH(544): HUNDREDTH-MS TIMER
The Completion Flag is turned OFF. (The PV cannot
be read.)
Instructions reset Operation of CNRX(547)
Binary TIMX(550): HUNDRED-MS TIMER
TIMHX(551): TEN-MS TIMER
TMHHX(552): ONE-MS TIMER
TTIMX(555): ACCUMULATIVE TIMER
TIMWX(816): HUNDRED-MS TIMER WAIT
TMHWX(817):TEN-MS TIMER WAIT
CNTX(546): COUNTER
CNTRX(548): REVERSIBLE COUNTER
CNTWX(818): COUNTER WAIT
The PV is set to its maximum value (FFFF hex) and
the Completion Flag is turned OFF.
TIMUX(556): TENTH-MS TIMER
TMUHX(557): HUNDREDTH-MS TIMER
The Completion Flag is turned OFF. (The PV cannot
be read.)
CNR
T0002
T0005
0.00
CNR
C0003
C0007
0.01
CNRX
T0002
T0005
0.00
CNRX
C0003
C0007
0.01
When CIO 0.00 is ON in the following example,
the Completion Flags for timers T0002 to T0005
are turned OFF and the timers' PVs are set to
the maximum value (9999 for BCD).
When CIO 0.01 is ON, the Completion Flags for counters
C0003 to C0007 are turned OFF and the counters' PVs are
set to the maximum value (9999 for BCD).
When CIO 0.00 is ON in the following example,
the Completion Flags for timers T0002 to T0005
are turned OFF and the timers' PVs are set to
the maximum value (FFFF for binary).
When CIO 0.01 is ON, the Completion Flags for counters
C0003 to C0007 are turned OFF and the counters' PVs are
set to the maximum value (FFFF for binary).