5: S
PECIAL
F
UNCTIONS
5-10
FC5A M
ICRO
S
MART
U
SER
’
S
M
ANUAL
FC9Y-B1268
Two-phase High-speed Counter HSC1 (All-in-One Type CPU Modules)
Two-phase high-speed counter HSC1 operates in the rotary encoder mode, and counts up or down input pulses to input
terminals I0 (phase A) and I1 (phase B). When the current value overflows 65535 or underflows 0, a designated compari-
son output turns on. Any output terminal available on the CPU module can be designated as a comparison output. When
input I2 (reset input) is turned on, the current value is reset to a predetermined reset value, and the two-phase high-
speed counter counts subsequent input pulses starting at the reset value.
Six special internal relays and two special data registers are assigned to control and monitor the two-phase high-speed
counter operation. The current value is stored in data register D8045 (current value) and is updated every scan. The value
stored in D8046 (reset value) is used as a reset value. When a high-speed counter reset input (I2 or M8032) is turned on,
the current value in D8045 is reset to the value stored in D8046.
The two-phase high-speed counter is enabled while gate input special internal relay M8031 is on and is disabled while
M8031 is off. When current value overflow or underflow occurs while counting up or down, special internal relay M8131
or M8132 turns on in the next scan, respectively. At this point, the D8045 current value is reset to the D8046 reset value
for the subsequent counting cycle. When comparison output reset special internal relay M8030 is turned on, the desig-
nated comparison output is turned off. When reset input I2 is turned on to reset the current value, reset status special
internal relay M8130 turns on in the next scan. When reset input special internal relay M8032 is turned on, M8130 does
not turn on. See page 5-11.
Special Internal Relays for Two-phase High-speed Counter (All-in-One Type CPU Modules)
Description
High-speed Counter No.
ON
Read/Write
HSC1
HSC2
HSC3
HSC4
Comparison Output Reset
M8030
—
—
—
Turns off comparison output
R/W
Gate Input
M8031
—
—
—
Enables counting
R/W
Reset Input
M8032
—
—
—
Resets the current value
R/W
Reset Status
M8130
—
—
—
Current value reset by I2
Read only
Current Value Overflow
M8131
—
—
—
Overflow occurred
Read only
Current Value Underflow
M8132
—
—
—
Underflow occurred
Read only
Note:
Special internal relays M8130 through M8132 go on for only one scan.
Special Data Registers for Two-phase High-speed Counter (All-in-One Type CPU Modules)
Description
High-speed Counter No.
Updated
Read/Write
HSC1
HSC2
HSC3
HSC4
High-speed Counter Current Value
D8045
—
—
—
Every scan
Read only
High-speed Counter Reset Value
D8046
—
—
—
—
R/W
Two-phase High-speed Counter Functions (All-in-One Type CPU Modules)
Counting Mode
1-edge count (phases A, B, Z)
Maximum Counting Frequency
50 kHz
Counting Range
0 to 65535 (16 bits)
Gate Control
Enable/disable counting
Current Value Reset
Current value is reset to a given value when the current value overflows 65535 or underflows
0, or when reset input I2 or reset input special internal relay M8032 is turned on.
Control/Status Relays
Special internal relays are provided to control and monitor the high-speed counter operation.
Comparison Output
Any output number available on the CPU module can be designated as a comparison output
which turns on when current value overflow or underflow occurs.
Output numbers on expansion output or mixed I/O modules cannot be designated as a com-
parison output.
Phone: 800.894.0412 - Fax: 888.723.4773 - Web: www.clrwtr.com - Email: [email protected]