19 BUILT-IN I/O FUNCTION
19.2 FX3-compatible high-speed counter function
165
19
19.2 FX3-compatible high-speed counter function
FX3-compatible high-speed counter function is explained below.
FX3-compatible high-speed counter function overview
The FX3 compatible high-speed counter can assign the input terminals compatible with FX3 and use the device equivalent to
C235 to C255 of FX3 as LC35 to LC55 (high-speed counter).
If the FX3 compatible high-speed counter is used, it is necessary to use the parameter to set the FX3 compatible high-speed
counter to be valid.
This section describes the device (LC35 to LC55) of the FX3 compatible high-speed counter as an LC device.
The FX3 compatible high-speed counter is convenient if it is used when a replacement is made from FX3 or
for a similar occasion. If a high-speed counter is newly used, use the high-speed counter function of FX5.
(Page 114 High-speed Counter Function)
How to start/stop the high-speed counter using the LC device
The method of starting/stopping the counting of the high-speed counter using the LC device is as follows.
Programs example
In the case of a program shown below, the counting starts when M0 turns ON, and the counting stops when M0 turns OFF.
When the counter increases from -6 or less to -5 or higher during an execution of the UDCNTF instruction, the counter contact
turns ON, and the counter contact turns OFF when the counter decreases from -5 or higher to -6 or lower.
• The current value of LC35 is updated when the UDCNTF instruction is executed.
• When LC35 is set to (s) of the DHCMOV instruction, the newest value can be read out.
• When a high-speed comparison instruction (DHSCS instruction, DHSCR instruction, DHSZ instruction), a
high-speed comparison table, or a multi-point output high-speed comparison table are used, an accurate
comparison and matched output processing can be executed.
The set value (positive or negative) can be specified by a constant (K) or the contents of data registers (D). When data
registers are used, 32-bit data composed of two consecutive devices are treated as set values. If D0 is specified, the pair of
D1 and D0 are the setting value of 32 bits.
Operation example
The operation of LC35 in the programming example described above is as shown below.
M0
LC35
Setting value (constant)
Indirect specification is possible
Y001
UNCNTF LC35 K-5
Count direction
Up-count Up-countDown-count
00 0
-1 -1
-2 -2
-3 -3
-4 -4
-5 -5
-6 -6
-7 -7
-8
11
22
33
44
5
X000 Pulse input
LC35 Current value
LC35 Count contact
= Y001
When output has operated