Examples of pulse output, Kv -300 – KEYENCE Visual KV Series User Manual
Page 308

6.2 High-speed Counters
KV
-300
KV-10/80
3-284
6
Chapter 6 Interrupts, High-speed Counters, Positioning Control
Examples of Pulse Output
The following sample explains how to program the pulse output.
Example of clock pulse with 1:1 ON/OFF ratio
■ When outputting clock pulse with cycle 1 ms (1 kHz) from 0500
This program example shows how to output clock pulse with 1:1 ON/OFF ratio from
0500, through High-speed counter CTH0 and High-speed counter comparator
CTC0.
Setting special utility relays
Special utility relays 2103 to 2112 are set as shown on the right table.
The program can be simplified using reverse output (toggle) for pulse with 1:1 ON/
OFF ratio.
Values set to the internal clock and CTC0
After the internal clock is determined, the CTC0 setting value is calculated from the
following expression.
CTC0 setting value = Pulse cycle (µs) ÷ Internal clock (µs) ÷ 2
Assign 1 ms to pulse cycle and 10 µs (2101: special utility relay) to internal clock
and calculate the CTC0 setting value.
The calculated result is "50".
CTC0 values calculated based on other internal clocks are listed below for your
reference.
Programming example
•
The status of output 0500 is set by turning ON one of the relays 2104 to 2107 at
the beginning of the program. In Example, output of direct clock pulses to 0500 is
enabled, and the status of output 0500 is inverted each time CTH0 = CTC0.
•
Turns ON special utility relay 2103 and specifies to clear CTH0 using CTC0. The
program repeats clearing the CTH0 current value with the value set to CTC0.
•
Resetting the current value of CTH0 at the beginning of the program allows direct
clock pulses of specified width to be output starting from the 1st pulse.
•
Input relay which enables CTH0 remains ON during clock pulse output.
➮ * Refer to page 3-276.
Special utility relay
Internal clock*
CTC0 value
2100
1.0 µs
500
2101
10.0 µs
50
2102
100.0 µs
5
2008
SET
2103
2104
2105
2106
2107
2002
0001
0002
0003
CTH0
2101
RES
RES
RES
SET
RES
CTH0
CTC0
#00050
CTH0 value
ON
OFF
CTC0
Relay No.
Setting
Relay No.
Setting
2103
ON
2112
OFF
2104
OFF
2108
OFF
2105
OFF
2109
OFF
2106
OFF
2110
OFF
2107
ON
2111
OFF
KVNKA Chap 06.p65
08.3.11, 0:10 PM
284