6-156
6.8 Other Convenient Instructions
6.8.2 Two-phase input up/down counter
UDCNT2
(3) Count processing is conducted as described below.
• When the count is going up, the counter contact specified for
turns ON when the
current value becomes identical with the setting value specified for n. However, the
current value count will continue even when the contact of the counter specified for
turns ON. (Refer to Program Example (1))
• When the count is going down, the counter for the contact specified for
turns OFF
when the current value reaches the setting value 1. (Refer to Program Example (1))
• The counter specified for
is a ring counter. If it is counting up when the current value is
32767, the current value will become 32768. Further, if it is counting down when the
current value is 32768, the current value will become 32767. The count processing
performed on the current value is as shown below.
(4) Count processing conducted according to the UDCNT2 instruction begins when the
execution command is turned from OFF to ON, and is suspended when it is turned from ON
to OFF.
When the execution command is turned from OFF to ON again, the counting resumes from
the suspended value.
(5) The RST instruction clears the current value of the counter specified for
and turns the
contact OFF.
1. 1. With the UDCNT2 instruction, the argument device data are registered in the
work area of the CPU module and counting operation is processed as a system
interrupt. (The device data registered in the work area is cleared by turning the
execution command OFF, or turning the STOP/RUN switch from STOP to
RUN.) For this reason, the pulses that can be counted must have longer ON
and OFF times than the interrupt interval of the CPU module. The interrupt
interval of each module is shown below:
2. The setting value cannot be changed during counting directed by the UDCNT2
instruction (while the execution command is ON). To change the setting value,
turn OFF the execution command.
3. Counters specified by the UDCNT2 instruction cannot be used by any other
instructions. If they are used by other instructions, they will not be capable of
returning an accurate count.
4. The UDCNT2 instruction can be used as many as 5 times within all the
programs being executed. The sixth and the subsequent UDCNT2 instructions
are not processed.
CPU module model
Interrupt interval
High Performance model QCPU, Universal model QCPU
1ms
d
d
d
d
3
2
7
6
8
3
2
7
6
7
2
1
0
1
2
3
2
7
6
7
3
2
7
66
W
h
en counting do
w
n
W
h
en counting u
p
d
Содержание MELSEC Q Series
Страница 1: ...Structured Programming Manual Mitsubishi Programmable Controller QCPU Common Instructions ...
Страница 2: ......
Страница 14: ...A 12 MEMO ...
Страница 340: ...6 178 MEMO MTR ...
Страница 708: ...7 368 MEMO ...
Страница 776: ...8 68 MEMO ...
Страница 796: ...9 20 MEMO ...
Страница 804: ...App 8 MEMO ...
Страница 812: ...Index 8 MEMO ...
Страница 815: ......