Rockwell Automation 1756-LSC8XIB8I ControlLogix Low-speed Counter Module User Manual

Page 12

Advertising
background image

12

Rockwell Automation Publication 1756-UM536A-EN-P - April 2012

Chapter 2

Module Operation

Each of the eight counters automatically returns the values described in

Table 3

.

Table 3 - Counter Values

Value

Data Type

Description

Accumulated count

DINT

The total number of pulses. The module counts pulses on their rising edge. The module stores accumulated count in the Counter[x].Count
input tag.

Instantaneous frequency

REAL

The frequency of the last pulse detected by a counter. The module calculates frequency by timing from rising edge to rising edge of the
last two pulses (cycle time):
If the cycle time is less than the frequency timeout (Counter[x].FreqTimeout) value, then instantaneous frequency = 1/cycle time.
If the cycle time is greater than the frequency timeout (Counter[x].FreqTimeout) value, then instantaneous frequency = 0.
In instantaneous frequency calculations, the rising edge of the pulse that completes a cycle time is also the rising edge of the pulse that
starts the next cycle time.
To determine the accuracy of the instantaneous frequency value, use this formula:
0.0011 x Counter[x].Frequency value
For example, a 1 kHz input frequency has a worst case instantaneous frequency value of ±1.1%.
The module stores instantaneous frequency in the Counter[x].Frequency input tag.

Average frequency

(1)(2)

REAL

The average frequency of pulses. The module calculates average frequency over the number of pulses defined in the
Counter[x].FreqAveragePulseCount configuration tag. You can configure this number of pulses on the Counter Configuration tab of the
Module Properties dialog box.
The module calculates average frequency as follows.
1. Starts timing on the first rising pulse edge and stops timing on the Counter[x].FreqAveragePulseCount rising pulse edge.
2. Calculates frequency based on the total time from step 1 and multiplies the Counter[x].FreqAveragePulseCount value by the pulse

count.

For example, if Counter[x].FreqAveragePulseCount = 10 and the calculated frequency = 1 Hz, the average frequency = 10 Hz (10 pulses/
1 second).
If Counter[x].FreqAveragePulseCount = 10, the module updates average frequency values as follows:
From pulses 0…9, the module does not calculate average frequency and returns a value of zero.
From pulses 10…19, the module calculates and updates the average frequency for pulses 0…9 at pulse 10.
From pulses 20…29, the module calculates and updates the average frequency for pulses 10…19 at pulse 20, and so on.
The module stores the average frequency in the Counter[x].FreqAverage input tag.

Instantaneous pulse width

REAL

The duration in microseconds of the last rising pulse edge to falling pulse edge. The accuracy of the instantaneous pulse width is always
± -11μs regardless of the actual pulse width. The module stores instantaneous pulse width in the Counter[x].PulseWidth input tag.

Average pulse width

(1)

REAL

The average width of pulses. The module calculates average pulse width over the number of pulses specified in the
Counter[x].FreqAveragePulseCount configuration tag. Frequency timeouts do not affect the pulse width average. If the input is high or
low for a long period of time, the average pulse width is not updated until the number of pulses in the
Counter[x].FreqAveragePulseCount tag occurs.
The module calculates average pulse width as follows.
1. Stores each instantaneous pulse width for the number of pulses in the Counter[x].FreqAveragePulseCount tag.
2. Calculates the total of all pulse widths stored in step 1 and divides the total by the value in the Counter[x].FreqAveragePulseCount

tag.

If Counter[x].FreqAveragePulseCount = 10, the module calculates average pulse width as follows:
From pulses 0…9, the module does not calculate average pulse width and returns a value of zero.
From pulses 10…19, the module calculates average pulse width for pulses 0…9 at pulse 10.
From pulses 20…29, the module calculates average pulse width for pulses 10…19 at pulse 20, and so on.
The accuracy of the average pulse width is always ± - 11 μs/Counter[x].FreqAveragePulseCount regardless of the actual pulse width.
The module stores average pulse width in the Counter[x].PulseWidthAverage input tag.

(1) The average frequency and average pulse width may not be calculated on the same pulse due to frequency timeouts.
(2) Frequency timeouts may cause the accuracy of average frequency calculations to vary.

Advertising