5: S
PECIAL
F
UNCTIONS
5-28
FC5A M
ICRO
S
MART
U
SER
’
S
M
ANUAL
FC9Y-B1268
Example: Two-phase High-speed Counter (Slim Type CPU Module)
This example demonstrates a program for two-phase high-speed counter HSC1 to punch holes in a paper tape at regular
intervals.
Description of Operation
Feed Roller
Rotary Encoder
Tape Punch
Rolled Tape
A rotary encoder is linked to the tape feed roller directly, and the out-
put pulses from the rotary encoder are counted by the two-phase
high-speed counter in the MicroSmart CPU module. When the high-
speed counter counts 2,700 pulses, the comparison output is turned
on. When the comparison output is turned on, the high-speed coun-
ter continues another cycle of counting. The comparison output
remains on for 0.5 second to punch holes in the tape, and is turned
off before the high-speed counter counts 2,700 pulses again.
Program Parameters
PLC Selection
FC5A-D32
Function Area Settings
Group 1 (I0-I2)
Two/Single-phase High-speed Counter
Enable Comparison 1
Yes
Comparison Output
Q1
Keep Current Value
No
Enable Comparison 2
No
Enable Overflow Action
No
Enable Underflow Action
No
Special Data Registers
HSC Preset Value 1 High Word (D8212)
0
HSC Preset Value 1 Low Word (D8213)
2700
HSC Reset Value High Word (D8216)
0
HSC Reset Value Low Word (D8217)
0
Note:
This example does not use the phase Z signal (input I2).
Programming WindLDR
Phone: 800.894.0412 - Fax: 888.723.4773 - Web: www.clrwtr.com - Email: [email protected]