85
FX
3U
/FX
3UC
Series Programmable Controllers
Programming Manual - Basic & Applied Instruction Edition
4 Devices in Detail
4.6 Counter [C]
1
In
troduct
io
n
2
Ov
e
rv
ie
w
3
In
st
ru
ct
ion
Li
st
4
D
evi
ce
s
in
De
ta
il
5
Speci
fied t
h
e
D
evi
ce &
C
onst
a
nt
6
Bef
o
re
Pr
ogr
a
m
m
ing
7
Bas
ic
In
st
ru
cti
o
n
8
FNC0
0
-FNC0
9
P
ro
g
ra
m F
lo
w
9
FNC1
0
-FNC1
9
M
ov
e
&
C
om
par
e
10
FNC
20-
FNC
2
9
Ar
ith.
&
Logi
c
O
per
at
io
n
• When the coil C200 is driven by the counting input X014, a counter starts up-counting or down-counting.
When the current value of a counter increases from "
−
6" to "
−
5", the output contact is set. When the
current value decreases from "
−
5" to "
−
6", the output contact is reset.
• The current value increases or decreases without regard to the operation of the output contact. When a
counter executes up-counting from "+2,147,483,647", the counter value becomes "
−
2,147,483,648". In the
same way, when a counter executes down-counting from "
−
2,147,483,648", the counter value becomes
"+2,147,483,647". (This type of counter is called ring counter.)
• When the reset input X013 turns ON and then RST instruction is executed, the current value of the counter
is reset to "0" and the output contact returns.
• In a latch type counter, the current value, output contact operation and reset status of the counter are
latched (battery backed) by the battery built in the PLC.
→
For the details of backup method against power failure, refer to Section 2.6.
• A 32-bit counter can be used as a 32-bit data register. 32-bit counters cannot be handled as target devices
in 16-bit applied instructions.
• If data beyond the set value is written to the current value register by DMOV instruction, etc., the counter
continues counting and the contact does not change when the next counting input is received.
4.6.5
Set value specification method
1. 16-bit counter
1) Specification by constant (K)
2) Indirect specification (D)
X013
RST
C200
X014
C200
C200
Y001
K-5
Set value (constant)
It can be specified
indirectly also.
X012
M8200
X012
X013
X014
Current
value
Y001
Up counting
Down counting
Up counting
0
1
2
3
4 5 4
3
2
1
0
−
1
−
2
−
3
−
4
−
5
−
6
−
7
−
8
When output has
been already
activated.
−
7
−
6
−
5
−
4
−
3
0
X003
C 0
K100
Constant (decimal constant): 1 to 32767
100 counts
X001
FNC 12
MOV
K100
D 5
X003
C 0
D 5
D5 = 100
100 counts
Write the contents of a data register used for indirect
specification in advance in a program, or receive them in
advance by a digital switch.
Note that the set value at latched (battery backed) type
resister can become indefinite when the battery voltage is
low.