Omron CP1E-N@@D@-@ Computer Hardware User Manual


 
2-87
2 Instructions
CP1E CPU Unit Instructions Reference Manual(W483)
Timer and Counter Instructions
2
CNR/CNRX
Precautions
The timer/counter that is reset is as follows.
The CNR(545)/CNRX(547) instructions do not reset TIML(542) and TIMLX(553), because these tim-
ers 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.
Sample program
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
CNT: COUNTER
CNTR(012): REVERSIBLE COUNTER
The PV is set to its maximum value (9,999 BCD) and
the Completion Flag is turned OFF.
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
CNTX(546): COUNTER
CNTRX(548): REVERSIBLE COUNTER
The PV is set to its maximum value (FFFF hex) and
the Completion Flag is turned OFF.
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).