U
SER
’
S
M
ANUAL
17-1
17: H
IGH
-
SPEED
C
OUNTER
I
NSTRUCTIONS
Introduction
MICRO
3
features high-speed counter functions which can be used for position control by counting high-speed pulses or for
simple motor control in combination with the pulse output. This function can also be used in combination with a pulse
generator to measure lengths or widths of objects.
The ordinary counter instruction counts only one pulse in one scan, and the counting speed depends on the scan time. The
high-speed counter can count many input pulses in one scan and make it possible to count high-speed pulses faster than the
scan time. If the high-speed counter counts input pulses representing a position, the current position can be determined.
This function is useful for position control.
The HSC0 is a high-speed counter with a single-stage comparison function. When the current value is equal to or greater
than the preset value (
4,294,967,295
maximum), a designated output or internal relay is turned on.
The HSC1 is a multi-stage comparison counter. The preset value and output data are programmed in data registers. When
preset values are reached (
4,294,967,295
maximum), designated outputs or internal relays are turned on in sequence.
The HSC2 is a pulse output control counter used with the PULS (pulse output) instruction. When a preset value is reached,
a designated output or internal relay is turned on, and the pulse output at output Q0 is turned off.
The HSC3 is a gate-controlled counter without comparison function. When the gate input is turned off, the current value is
moved to a designated data register.
Note:
The high-speed counter function can be used with the 24V DC input type
MICRO
3
only, not with the AC input type.
High-speed Counter Specifications (Hard Filter Value: 10)
Note:
The input response frequency of the high-speed counter depends on the hard filter setting. The soft filter does not
affect the high-speed counter function. See Input Filter Function on page 4-3.
A1 HSC0 (Single-stage Comparison)
The high-speed counter current value is reset to 0 when
MICRO
3
is powered up. The high-speed counter holds the current
value while
MICRO
3
is stopped and restarts counting input pulses starting with the existing current value. Include the hard
reset or soft reset in the user program, if necessary.
Note:
Only one of HSC0 through HSC3 and A/D instructions can be used only once in a user program.
Key Operation
Valid Operands (Standard Processing)
In the high-speed processing mode, operands for advanced instructions are limited. See page 6-1.
High-speed Counter HSC0 HSC1 HSC2 HSC3
Counted Value Range
0 to 4,294,967,295
(FFFF FFFFh)
0 to 4,294,967,295
(FFFF FFFFh)
0 to 4,294,967,295
(FFFF FFFFh)
0 to 65,535
(FFFFh)
Points
1 point 1 point 1 point 1 point
Phase
Single phase Single phase Single phase Single phase
Maximum Frequency
10 kHz 5 kHz
5 kHz
(4 kHz when using program loader)
10 kHz
Operand Function I Q M T C R D Constant Repeat
S1 (Source 1) Preset value — — — — — — 0-99 1-4,294,967,295 —
D1 (Destination 1) High-speed counter output — 0-31 0-287 — — — — — —
High-speed counter 0 counts input pulses to input I0. When the current value is
equal to or greater than the preset value designated by source operand S1, the output
or internal relay designated by destination operand D1 is turned on.
D1
****
S1
****
HSC0
LOW
ADV
1
BPS
0 (I0)
HSC0
S1
D1: (*---)
Enter operands S1 and D1.
To select hard reset mode from LOW, HIGH, or unused,
press the REP key.
To exit, press the key.
NOT
A