Mitsubishi Electronics FX3G Manuale Utente

Pagina di 964
119
FX
3S
/FX
3G
/FX
3GC
/FX
3U
/FX
3UC
 Series
Programming Manual - Basic & Applied Instruction Edition
4 Devices in Detail
4.8 High-Speed Counter [C] (FX3U/FX3UC PLC)
1
Introdu
ction
2
Ov
ervi
ew
3
Instruction 
Li
st
4
D
evices 
in Det
ai
l
5
Specifi
ed the
De
vice
 &
 
C
onst
ant
6
Bef
ore
 
Pr
og
ra
mmi
ng
7
Bas
ic 
Instruction
8
FN
C00-FN
C0
9
Program Fl
ow
9
FNC
10-FN
C19
Mov
e & Com
pare
10
FNC
20-FNC
29
Arith. & Lo
gi
Operati
on
Restriction to overlap input numbers
• Inputs X000 to X007 are used for high-speed counters, input interrupt, pulse catch, SPD/ZRN/DSZR/DVIT 
instructions and general-purpose inputs. When assigning functions, there should be no overlap between those 
input terminals.
• Since  the  FX
3U
-4HSX-ADP and FX
3UC
 PLC main unit share the same assigned input terminal numbers, only one of 
them may be used in operation. If both input terminals are used, intended operation is not enabled because the 
inputs of the FX
3U
-4HSX-ADP and PLC main unit operate in an "OR" relationship.
4.8.3
Handling of high-speed counters
1. 1-phase 1-count input
C235 counts "OFF
→ ON" of the input X000 while X012 is 
ON.
When X011 turns ON and then RST instruction is executed, 
C235 is reset.
The counting direction of the counters C235 to C245 is 
switched to down-count or up-count when M8235 to M8245 
turns ON or OFF.
C244 immediately starts counting when the input X006 turns 
ON while X012 is ON. The counting input is X000. In this 
example, the set value is indirectly specified by the contents 
of data registers (D1 and D0).
A high-speed counter can be reset using X011 in a sequence 
as shown in the figure, but C244 immediately reset without 
any program when X001 is closed. So a program with X011 is 
not necessary. 
The counting direction of the counters C235 to C245 is 
switched to down-count or up-count when M8235 to M8245 
turns ON or OFF.
Operation example
The counter C235 shown above operates as follows:
When counting with input X000, C235 executes up-count or down-count as an interrupt.
• 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 regardless of the operation of the output contact. When a counter 
executes up-count from "+2,147,483,647", the counter value becomes "
−2,147,483,648". In the same way, when a 
counter executes down-count from "
−2,147,483,648", the counter value becomes "+2,147,483,647". (This type of 
counter is called a ring counter.)
• When the reset input X011 turns ON and RST instruction is executed, the current value of the counter is reset to "0" 
and the output contact is restored.
• In a latch type high-speed counter, the current value, output contact operation and reset status of the counter are 
latched (battery backed) by the backup battery built in the PLC.
X010
M8235
Down/up count
X011
X012
C235
K-5
RST
C235
Reset
X010
M8244
Down/up count
X011
X012
C244
D0(D1)
RST
C244
Reset
Set value is (D1, D0)
X010
X011
X000
C235
Current
value
C235 output contact
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
already been activated
−7
−6−5
−4−3
0
X012
Reset input
Start input
Counting
input