287
UDCNT1
1
2
3
4
6
7
8
6.8
O
ther Con
venient Instru
ctions
6.8.1
UDCN
T1
6.8
Other Convenient Instructions
:
+ 0: Input number for count input (bits)
+ 1: For setting count up/down (bits)
• OFF: Count up (add numbers when counting)
• ON: Count down (subtract numbers when counting)
: Number of the counter to be enabled to start counting with the UDCNT1 instruction (Device name)
n
: Value to set (BIN 16 bits)
*1:
Only the X device can be used for . 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.
Function
(1) When the input designated at goes from OFF to ON, the present value of the counter designated at will be updated.
(2) The direction of the count is determined by the ON/OFF status of the input designated by +1.
• OFF: Count up (counts by adding to the present value)
• ON : Count down (counts by subtracting from the present value)
(3) Count processing is conducted as described below:
• When the count is going up, the counter contact designated at 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 goes ON. (See Program Example (1))
• When the count is going down, the counter for the contact designated at goes OFF when the present value
reaches the set value -1. (See Program Example (1))
• The counter designated at 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:
(4) 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.
(5) The RST instruction clears the present value of the counter designated at and turns the contact OFF.
UDCNT1
Counter 1-phase input up or down
6.8.1
UDCNT1
Setting
Data
Internal Devices
R, ZR
J \
U \G
Zn
Constants
K, H
Other
Bit
Word
Bit
Word
(Only X)
*1
––
––
––
––
––
(Only C)
*2
––
––
––
n
*2
*2
*2
––
Basic
Redundant
Process
High
performance
Universal
LCPU
Command
U
DCNT1
n
UDCNT1
S
D
S
S
S
D
S
D
S
S
D
S
D
D
D
D
32768
32767
2
1
0
1
2
32767
32766
W
hen counting up
W
hen counting down
D