EasyManua.ls Logo

Mitsubishi Electric MELSEC-Q/L - Counter 2-Phase Input up or down

Mitsubishi Electric MELSEC-Q/L
1084 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
336
6 BASIC INSTRUCTIONS
6.8 Other Convenient Instructions
Counter 2-phase input up or down
UDCNT2
*1 Only the X device can be used for (S). However, the X device can be used only in the range of number of I/O points (the number of
accessible points to actual I/O modules).
*2 Local devices and the file registers set for individual programs cannot be used.
Processing details
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).
Direction of the count is determined in the following manner:
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.
When the count is going down, the counter for the contact specified by (D) turns off when the current value reaches the set
value - 1.
The counter specified by (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. The
count processing performed on the present value is as shown below:
Count processing conducted according to the UDCNT2 instruction begins when the count command goes from OFF to ON,
and is suspended when it goes from ON to OFF. When the execution command is turned OFF to ON again, the counting
resumes from the suspended value.
The RST instruction clears the present value of the counter designated at (D) and turns the contact OFF.
(S): (S)+0: Input number for count input (A phase pulse) (bits)
(S)+1: Input number for count input (B phase pulse) (bits)
(D): Number of the counter to be enabled to start counting with the UDCNT2 instruction (Device name)
n: Value to set (BIN 16 bits)
Setting
data
Internal device R, ZR J\ U\G Zn Constant
K, H
Others
Bit Word Bit Word
(S) (Only X)
*1

(D) 
*2
(Only C) 
n
*2
*2
*2
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.
Basic
Redundant
Process
High
performance
Universal
LCPU
Command
UDCNT2
n
UDCNT2 S D
32768 32767 2 1 0 1 2 3276732766
When counting down
When counting up

Table of Contents

Related product manuals