Basic Hardware and Function
273
8. Special I/O Functions
8.3 High speed counter
8.3.1 Single phase up-counter
Function
When the count input is changed from OFF to ON, the count value is increased by 1.
When the count value reaches the set value, the count value is reset to 0, and I/O
interrupt program is activated (if the interrupt enable flag is ON). The count value is reset
to 0 when the reset input comes ON.
This counter operation is enabled while the soft-gate is ON. The count value is reset to 0
when the soft-gate is changed from ON to OFF.
The set value is set internally at the timing of the soft-gate changing from OFF to ON.
When the soft-gate is OFF, the count value can be changed by writing the data into the
set value register and setting the count preset flag to ON.
The count value range is H0000 to HFFFF (16-bit data).
Hardware condition
Count input (X000 and X001)
ON/OFF pulse width: 100 ms or more (max. 5 kHz)
Reset input (X002 and X003)
ON/OFF duration: 2 ms or more
Related registers
SW16: Function selection. Refer to section 8.1.
Function Re
g
ister/device Remarks
Channel 1 Channel 2
Count input X000 X001 (Note)
Reset input X002 X003
Set value SW18 SW20 Data ran
g
e: H0000 to HFFFF
Count value SW22 SW23
Soft-
g
ate S240 S248 Operation is enabled when ON
Interrupt enable S241 S249 Interrupt is enabled when ON
Count preset S243 S24B Used to preset the counter value
Note) When both channels are used, X000 to X003 cannot be used as normal
input devices. However, if either one channel is used, these inputs for unused
channel can be used as normal input devices.
Interrupt assignment
Channel 1 ¼ I/O interrupt program #1
Channel 2 ¼ I/O interrupt program #2
CTi Automation - Phone: 800.894.0412 - Fax: 208.368.0415 - Web: www.ctiautomation.net - Email: info@ctiautomation.net