Professional Documents
Culture Documents
Points
1. The Wizard function simplifies the setup.
2. Cost and space reduction due to no need for expansion units.
3. Up to 100 kHz (50 kHz phase-contrast) x 4 ch.
System Overview............................................................................
Operation Contents........................................................................
The encoder pulses are counted with the KV Nano built-in high-speed counter and then the workpiece
length and feed rate are calculated from the pulse count or the number of rotations.
When using a comparator of the high-speed counter, the timing at which the current value of the high-
speed counter exactly reaches the setting value can be used as an interrupt cause.
ONE POINT
• Using a dedicated instruction (RCNT) allows the number of rotations to be measured easily.
• The KV-Nano Series is equipped with a high-speed counter that has up to 4 channels.
No. of CH 2 2 3 4 3
2
Application examples of the high-speed counter
Measurement of workpiece length and feed rate in Measurement of workpiece length and feed rate for a
electric wire production winding machine
3
Preparation for Wiring...................................................................
Prepare and connect the required devices.
1. KV-N14/24/40/60xx or KV-NC32T x 1 unit
2. Encoder (open collector method)
* The KV Nano Series does not support line driver output encoders.
Wiring..................................................................................................
Check the manual for wiring of other channels and the terminal block type.
4
How to Set the High-Speed Counter.......................................
Start KV STUDIO (Ver. 7.1 or later) to create a new project.
([KV-NC32] is selected as the supported model in this document.)
1. Select [Tools] > [CPU high-speed counter setup wizard] from the menu.
Select the high-speed counter channel to be used from the options displayed on the window.
5
3. Set the input mode for the high-speed counter.
Select the count input mode and input time constant.
ONE POINT
The high-speed counter function can be used as a high-precision timer in up to 50 ns units
when the internal clock input is selected.
Linear counter : Counts encoder pulses in the range specified in the count range. The overflow
detection relay is turned on when the current value exceeds the range.
Ring counter : Counts encoder pulses in the range between the upper and lower limit values.
The overflow detection relay is not turned on even when the current value
exceeds the range.
6
5. Set the comparator consistent operation parameters.
Set the “Operations for consistency” and the “Initial value” parameters.
* The KV-Nano Series uses the fixed output relays when a comparator becomes consistent.
CTH No. 0 1 2 3
Output relay R500 R501 R502 R503
6. Specify the module name to be output and confirm the high-speed counter settings.
7
Sample Programming...................................................................
This sample programme counts the workpiece length.
When a workpiece is detected (R000 is turned on), the high-speed counter is reset and encoder pulse
counting starts. The workpiece length will be calculated by the count at which R000 is turned off.
CTH0 count
[Ladder programme]
When the workpiece detection signal and the count need to be monitored simultaneously,
select [Monitor/Simulator] > [Registration monitor window] from the menu.
Register devices in
advance to make
debugging even easier.
8
Sample Programming...................................................................
The sample programme uses a combination of the high-speed counter and the interrupt processing for
cutting wire materials.
When MR000 is turned on, the programme starts motor speed control to feed the wire
material. The high-speed counter 0 (CTH0) counts the length of the fed wire material.
When the count reaches the CTC0 setting value (set length to be cut), the stop sensor
input is turned on. The interrupt processing stops the motor control to perform cutting.
The motor stops when MR002 is turned on.
After an operation time passes, the programme resumes the motor speed control and
repeats the operation described above.
Encoder
[Operation contents]
The stop sensor input is turned on when the current value of the
counter exactly reaches the CTC0 setting value (length to be cut).
Speed
MR000
Time
[Device specifications]
Device Device Comment Device Device Comment
9
[High-speed counter settings] [How to execute interrupt processing]
Channel : CTH0
ONE POINT
The KV Nano responds to the interrupt within 100 μs.
Select “Enabled” for the stop sensor setting and set the travel after stop
sensor input. When zero is set, feeding stops immediately after the stop
sensor input is turned on. When a value between 1 and 65535 is set, feeding
stops after traveling the set number of pulses.
10
[Ladder programme example]
* This diagram omits the high-speed counter programme that is created automatically.
The interrupt processing starts when CTC0 reaches the setting value.
When the count reaches 100,000 pulses, the axis 1 stop sensor input is turned on.
11
www.keyence.com
Copyright (c) 2013 KEYENCE CORPORATION. All rights reserved. KVN7-WW-AG-GB 1103-1 E 600D05