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, t he count value is reset to 0, and I/O
interrupt program is acti vated (if the interrupt enable flag is ON). The count value is reset
to 0 when the reset input com es ON.
This counter operation is enabled while the soft-gate is ON. The count value is reset to 0
when the soft- gate is chang ed from O N t o O FF.
The set value is set int er nally at t he t im ing of the soft-gate changing from O FF to ON.
When the sof t - gate is O FF, t he count value can be changed by writing the data into the
set value register and set ting the count preset flag to O N.
The count value rang e is H0000 to HFFFF (16-bit dat a) .
Hardware conditi on
Count input (X000 and X001)
ON/OFF pulse width: 100 ms or more (max. 5 kHz)
Reset input (X002 and X003)
ON/OFF dur at ion: 2 ms or mor e
Related regist ers
SW16: Function selection. Refer t o sect ion 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