6 - 115 6 - 115
MELSEC-Q/QnA
6 BASIC INSTRUCTIONS
High Performance
QnA Q4AR
Basic
QCPU
PLC CPU
Process CPU
6.8.2 Counter 2-phase input up or down (UDCNT2)
Usable Devices
Internal Devices
(System, User)
MELSECNET/10(H)
Direct J
\
Set
Data
Bit Word
File
Register
Bit Word
Special
Function
Module
U
\G
Index
Register
Zn
Constant
K, H
Other
S
(Only X)
D
(Only C)
n
: Local devices and the file registers set for individual programs cannot be used.
[Instruction Symbol] [Execution Condition]
Command
UDCNT2
n
UDCNT2
S D
[Set Data]
Set Data Meaning Data Type
• Input number for count input:
S
+0 (A phase pulse)
S
• Input number for count input:
S
+1 (B phase pulse)
Bit
D
• Number of counter that will perform count onUDCNT2 instruction
Word
n
• Set value
BIN16
[Functions]
(1) The present value of the counter designated by
D
is updated depending on the status of the
input designated by
S
(A phase pulse) and the status of the input designated by
S
+1 (B
phase pulse).
(2) Direction of the count is determined in the following manner:
•
When
S
is ON, if
S
+1 goes from OFF to ON, count up operation is performed (values are
added to the present value of the counter).
• When
S
is ON, if
S
+1 goes from ON to OFF, count down operation is performed (values
are subtracted from the present value of the counter).
•
No count operation is performed if
S
is OFF.
(3) Count processing is conducted as described below:
• When the count is going up, the counter contact designated at
D
goes ON when the present
value becomes identical with the setting value designated by n.
However, the present value count will continue even when the contact of the counter
designated at
D
goes ON. (See Program Example (1))
•
When the count is going down, the counter for the contact designated at
D
goes OFF when
the present value reaches the setting value minus 1. (See Program Example (1))
•
The counter designated at
D
is a ring counter.
If it is counting up when the present value is 32767, the present value will become -32768.
Further, if it is counting down when the present value is -32768, the present value will
become 32767.
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com