Operation
05/06 AWB2724-1584GB
40
Incrementing (Direction = FALSE): the counter counts up to the set
reference value (PRESET). Once the reference value has been
reached, this activates the configured interrupt which branches to
a program routine (a page 45). The counter continues counting
from zero when the next count pulse is received.
Decrementing (Direction = TRUE): with the first count pulse, the
actual value is set from 0 to the reference value. If an interrupt is
programmed, the associated program routine is called
(a page 45). With each further pulse, the actual value is reduced
until it reaches 0. On the next count pulse the reference value is
accepted again and the program routine is called again.
The following counter features can be defined via the program:
•Enable:
– TRUE: Pulses are counted.
– FALSE: Pulses are not counted.
– A “1” signal at the “Enable” input activates the counter: The
incoming pulses are counted. With the next 0 l 1 edge of the
Enable signal, the actual value is set to 0 and the status at
the “Direction input” and at the “Preset input” are accepted.
Any direction change during operation is not detected.
• Direction:
– FALSE: Up counting/incrementing
– TRUE: Down counting/decrementing
• Reset:
–A 0 l 1 edge at the “Reset” input will cause the actual value
to be set to 0 and the direction and reference value to be
accepted, irrespective of the status of the Enable signal.
•Preset
16-bit counter
Two of these counters are available.
The function of this counter is the same as that of the high-speed
counter (32-bit). In order to identify the two 16-bit counters, the
symbolic operands have a number: 0 or 1. The operands with 0
control count pulses that are present at input I1. Those with the
number 1 are for the count pulses of I2.
External inputs:
The counter number can be seen in the symbolic operands in the
PLC configurator in the folder “16Bit Counter”.
Incremental input
One incremental input is available. The incremental signals A and
B of the transmitter are sent to the external inputs I1 and I2, and
the reference signal that is generated by the transmitter with every
rotation is sent to input I3. The reference switch is connected to
input I4. When closed this forms the reference window in which
the reference signal is processed.
The incremental signals A and B are phase shifted by 90 degrees
in order to indicate the count direction. The rising and falling edges
are evaluated (quadrature decoding). The maximum input
frequency is 40 kHz. This results in a total frequency of 160 kHz.
The counter does not generate an interrupt.
You can control the counter and adapt it to the application with
the following signals. The signal inputs can be scanned and the
signal outputs set in the program. The signal designations are
provided in the PLC configuration.
Counter
number
Pulse input
0 I1
1 I2
Figure 34: Inputs/outputs of the 16-bit counter 0 and 1
h
When the actual values equals the reference value, an
interrupt can be generated in order to activate a program
routine. To do this, you must activate the interrupt in the
task configuration and assign the program routine,
a section “Interrupt processing”, page 45.