6.8 Other Convenient Instructions
6.8.2 Two-phase input up/down counter
6-155
6
BA
S
IC
INSTRUCTIONS
UD
CNT2
UDCNT2
6.8.2
Two-phase input up/down counter
UDCNT2
*1: Specify the array in which X is set as a device for global label.
*2 :Local devices and file registers per program cannot be used as setting data.
F
unct
i
on
(1) The current value of the counter specified for
is updated depending on the status of the
input specified for
(A-phase pulse) and the status of the input specified for
+1 (B-phase
pulse).
(2) Direction of the count is determined in the following manner.
• When
is ON, if
+1 turns from OFF to ON, count-up operation is performed. (Values
are added to the current value of the counter.)
• When
is ON, if
+1 turns from ON to OFF, count-down operation is performed.
(Values are subtracted from the current value of the counter.)
• No count operation is performed if
is OFF.
UDCNT2
indicates the following instruction.
UDCNT2
Input argument,
EN:
Executing condition
: Bit
s:
s+0:Input number for the counter input (A-phase pulse)
s+1:Input number for the counter input (B-phase pulse)
: Array of bit (0..1)
n:
Set value
: ANY16
Output argument,
ENO:
Execution result
: Bit
d:
Counter number that starts counting by the UDCNT2
instruction
: ANY16
Setting
data
Internal device
R, ZR
J
\
U
\G
Zn
Constant
K, H
Others
Bit
Word
Bit
Word
(X only)
*1
−
−
−
−
n
U
*2
U
*2
U
*2
−
−
U
*1
(C only)
−
−
−
U
n
i
versa
l
UD
Hi
g
h
Per
f
ormance
Structured ladder
ST
U
DCNT
2
EN
ENO
s
d
n
U
DCNT
2
(EN,s, n, d);
ENO:=
s
d
d
s
s
s
s
s
s
s
Summary of Contents for MELSEC Q Series
Page 1: ...Structured Programming Manual Mitsubishi Programmable Controller QCPU Common Instructions ...
Page 2: ......
Page 14: ...A 12 MEMO ...
Page 340: ...6 178 MEMO MTR ...
Page 708: ...7 368 MEMO ...
Page 776: ...8 68 MEMO ...
Page 796: ...9 20 MEMO ...
Page 804: ...App 8 MEMO ...
Page 812: ...Index 8 MEMO ...
Page 815: ......