Fast Counters in AC500 Devices¶
Note
For AC500 devices the function “fast counters” is available in S500 I/O modules as of firmware version V1.3.
For AC500-eCo devices the function “fast counters” is available in onboard I/Os of PM55x and PM56x.
Fast counters are only available for digital I/O Modules. The digital I/O modules on the I/O bus contain two fast counters per module. If the I/O module does not have digital outputs, the corresponding counter modes are not valid. In case of an incorrect parameter setting, a diagnosis message is sent.
A fast counter uses up to 2 digital inputs and one digital output (provided that it is available). If the fast counter is deactivated, the inputs and outputs reserved for the counter can be used for other tasks.
Fast Counters integrated in S500 Modules
The following table shows the S500 modules which contain a fast counter and which of the digital inputs and outputs are reserved for the counter.
Module | Assigned inputs *1) | Assigned output | Remarks | |
---|---|---|---|---|
Channel A | Channel B | Channel C *2) or (CF) | ||
DA501 | DC16 | DC17 | DC18 | The counter function is not available if the modules are mounted on the I/O buses CI581-CN or CI582-CN |
DA502 | DC16 | DC17 | DC18 (in mode 1 and mode 2) DO0 (in mode 101 and mode 102) *4) |
|
DC522 | C8 | C9 | C10 | |
DC523 | C16 | C17 | C18 | |
DC532 | C24 | C25 | C26 | |
DI524 | I24 | I25 | No hardware output available | |
DX522 | I0 | I1 | The counter does not activate any relay output | |
DC551-CS31 | C16 | C17 | C18 | The counter function is activated by setting the correct address on the module *3) |
CI501-PNIO, CI541-DP, CI581-CN | DI0 | DI1 | DO0 | |
CI502-PNIO, CI542-DP, CI582-CN | DI8 | DI9 | DO8 | |
CI590-CS31-HA | C8 | C9 | C10 | The counter function is activated by setting the correct address on the module *3) |
CI592-CS31 | DC8 | DC9 | DC10 | The counter function is activated by setting the correct address on the module *3) |
*1) The two hardware inputs (channels A and B) are also and always available within the normal process image, irrespective of the operating mode of the counter.
*2) The hardware output channel C is activated by the fast counter only in the operating modes 1 and 2. In the other operating modes, this output can be used for other purposes.
*3) The counter function of the CS31 bus modules can only be activated if a bus address greater than 70 is set on the module by means of the address rotary switches. In this case, the effective bus address equals the set address minus 70, and the counter is ready for operation. Example: A set bus address of 83 means that the effective bus address = (83 - 70) = 13 and that the integrated fast counter can be used. In this case the parameter “Fast counter operating mode” may not be 0!
*4) Especially for module DA502: The counter operating mode 101 is the same as mode 1, but the assigned output is DO0 instead of DC18. Also the counter operating mode 102 is the same as mode 2, but the assigned output is DO0 instead of DC18.
- Decentralized communication interface modules, mounted on the I/O bus of a processor module.
- CS31 bus modules. The fast counter can be set operational via the address setting of the module and setting of module parameter “Fast counter” (Fast counter operating mode).
- PROFINET bus modules CI501-PNIO (V3) or CI502-PNIO (V3) and the decentralized communication interface modules connected via I/O bus.
- Decentralized communication interface modules, connected to PROFINET bus modules CI504-PNIO or CI506-PNIO.
- PROFIBUS bus modules CI541-DP or CI542-DP and the decentralized communication interface modules connected via I/O bus.
- CANOPEN bus modules CI581-CN or CI582-CN.
The counter function is performed within the bus module and, accordingly, the decentralized communication interface module. It works independently of the user program and is therefore able to respond quickly to external signals. A simultaneous counter operation of several decentralized communication interface modules is possible.
Each module counter can be configured for one out of 10 possible modes. The desired operating mode is selected in the PLC configuration using module parameters. After that, it is activated during the initialization phase (power-on, cold start, warm start).
The data exchange to and from the user program is performed using input and output operands. While integrating a module containing a fast counter in the PLC configuration, the necessary operands are created and reserved immediately. Thus, a counter implementation carried out later on does not cause an address shift.
Features independent of the counter operating mode
- The pulses at the counters’ inputs or the evaluated signals of the traces A and B in case of incremental position sensors are counted.
- The counting frequencies of the bus modules PROFINET, PROFIBUS and CANOPEN are max. 200 kHz (in modes 1 to 6), max. 50 kHz (in mode 7), max. 35 kHz (in mode 9), and max. 20 kHz (in mode 10).
- If the modules DA501, DC522, DC523, DC532, DC551-CS31, CI592-CS31 and CI590-CS31-HA are used, each counting input must be circuited externally in series with a resistor of 470 W / 1 W, in order to safely avoid influences from the deactivated module outputs to the connected sensors.
- The positive signal edges are counted, if not noted differently.
- By setting the operating mode 0, the counting function is switched off. In this case, the reserved inputs and outputs can be used for other tasks. Simultaneous use of these terminals for the counter and other signals must be avoided.
- The counter’s actual value is provided as a double word (32 bits).
- The counter can count upwards in all operating modes. It counts beginning at the start value (set value) up to the end value (max. from 0 to 4,294,967,295 or hexadecimal from 00 00 00 00 to FF FF FF FF. After reaching 4,294,967,295, the counter jumps with the next pulse to 0. When the counter reaches the programmed end value, the counter output is stored permanently as CF = TRUE (end value reached). Only when the counter is set again (set value), CF is reset to FALSE.
Further Information
- Counting modes of the fast counters: Counting modes: Counting Modes
- Configuration of the fast counters: Configuration: Fast Counters
- Operation with the library Counter_AC500_V<>.lib: Library documentation: Counter Library