6.8 Other Convenient Instructions
6.8.1 Single-phase input up/down counter
6-153
6
BA
S
IC
INSTRUCTIONS
UD
CNT1
UDCNT1
(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) The UDCNT1 instruction triggers counting when the execution command is turned from OFF
to ON and suspends counting when the execution command 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. With the UDCNT1 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 UDCNT1
instruction (while the execution command is ON). To change the setting value,
turn OFF the execution command.
3. Counters which have been specified by the UDCNT1 instruction cannot be
used by other instructions. If they are used by other instructions, they will not be
capable of returning an accurate count.
4. The UDCNT1 instruction can be used as many as 6 times within all the
programs being executed. The seventh and the subsequent UDCNT1
instructions are not processed.
O
p
erat
i
on
E
rror
In the following case, an operation error occurs, the error flag (SM0) is turned ON, and the
corresponding error code is stored to SD0.
• The device specified for
exceeds the corresponding device range. (For Universal
model QCPU only)
(Error code: 4101)
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 u
p
W
h
en counting do
w
n
d
s
Содержание 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: ......