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


 
2 Instructions
2-84
CP1E CPU Unit Instructions Reference Manual(W483)
Function
Precautions
Counter numbers are shared by the CNT, CNTX(546), CNTR(012) and CNTRX(548) instructions. If
two counters share the same counter number but are not used simultaneously, a duplication error will
be generated when the program is checked but the counters will operate normally. Counters which
share the same counter number will not operate properly if they are used simultaneously.
The PV will not be changed if the increment and decrement inputs both go from OFF to ON at the
same time. When the reset input is ON, the PV will be reset to 0 and both count inputs will be
ignored.
The Completion Flag will be ON only when the PV has been incremented from the SV to 0 or decre-
mented from 0 to the SV; it will be OFF in all other cases.
When inputting the CNTR(012)/CNTRX(548) instruction with mnemonics, first enter the increment
input (II), then the decrement input (DI), the reset input (R), and finally the CNTR(012)/CNTRX(548)
instruction. When entering with the ladder diagrams, first input the increment input (II), then the
CNTR(012)/CNTRX(548) instruction, the decrement input (DI), and finally the reset input (R).
Sample program
The counter PV is reset to 0 by turning the reset input (CIO 0.02) ON and OFF. The PV is incremented
by 1 each time that the increment input (CIO 0.00) goes from OFF to ON. When the PV is incremented
from the SV (3), it is automatically reset to 0 and the Completion Flag is turned ON.
Likewise, the PV is decremented by 1 each time that the decrement input (CIO 0.01) goes from OFF to
ON. When the PV is decremented from 0, it is automatically set to the SV (3) and the Completion Flag
is turned ON.
The counter PV is incremented by 1 every
time that the increment input goes from OFF
to ON and it is decremented by 1 every time
that the decrement input goes from OFF to
ON. The PV can fluctuate between 0 and the
SV.
When incrementing, the Completion Flag will
be turned ON when the PV is incremented
from the SV back to 0 and it will be turned
OFF again when the PV is incremented from
0 to 1.
When decrementing, the Completion Flag will
be turned ON when the PV is decremented
from 0 up to the SV and it will be turned OFF
again when the PV is decremented from the
SV to SV-1.
0
0
ON
OFF
0
ON
OFF
Increment input
Counter PV
Decrement input
SV
+1
Counter PV
Completion Flag
SV
-1
Counter PV
Completion Flag