Other Convenient Instructions; Other Convenient Instructions; Counter 1-Phase Input Up Or Down - Mitsubishi Electric MELSEC-Q/L Programming Manual

Hide thumbs Also See for MELSEC-Q/L:
Table of Contents

Advertisement

6.8

Other Convenient Instructions

Counter 1-phase input up or down

UDCNT1
Basic
High
Process
performance
UDCNT1
(S): (S)+0: Input number for count input (bits)
(S)+1: For setting count up/down (bits)
 OFF  Count up (add numbers when counting)
 ON  Count down (subtract numbers when counting)
(D): Number of the counter to be enabled to start counting with the UDCNT1 instruction (Device name)
n:
Value to set (BIN 16 bits)
Setting
Internal device
data
Bit
 (Only X)
(S)
(D)
*2
n
*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
• When the input designated at (S) goes from OFF to ON, the present value of the counter designated at (D) will be updated.
• The direction of the count is determined by the ON/OFF status of the input designated by (S)+1.
• OFF: Count up (counts by adding to the present value)
• ON: Count down (counts by subtracting from the present value)
• 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:
32768
32767
• The UDCNT1 instruction triggers counting when the execution command is turned OFFON and suspends counting when
the execution command is turned ONOFF. When the execution command is turned OFF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.
6 BASIC INSTRUCTIONS
334

6.8 Other Convenient Instructions

Redundant
LCPU
Universal
Command
R, ZR
Word
*1
*2
(Only C)
*2
*2
2
1
0
1
2
When counting up
When counting down
UDCNT1
J\
U\G
Bit
Word
32766
32767
n
S
D
Zn
Constant
K, H
Others

Advertisement

Table of Contents
loading

Table of Contents