Control of the Fast CountersΒΆ

Control of the Fast Counters is performed via the item Fast Counter in the I/O mapping of the tab [S500 I/O device name] I/O Mapping of the editor window:

../_images/5771ee6a45ff10680a33139000eba54e2

The channels can be mapped as described in Symbolic Names for Variables, Inputs and Outputs and have the following meaning Symbolic Names for Variables, Inputs and Outputs:

Channel Direction Width Meaning
Actual value X Input DWORD Current value of the Fast Counter
State byte X Input BYTE

Bit 0 = CF

If the counter reaches the programmed end value, the counter output is stored permanently as CF = TRUE (end value reached). Only if the counter is set again (set value), CF is reset to FALSE.

Bit 1 to Bit 7 free

Start value X Output DWORD Each counter can be set to a start value. Start values are loaded into the counter by the user program. Using the set signal (dependent on the operating mode either via a terminal or the bit SET within the control byte X), the values of the double word variables are loaded into the counter X.
End value X Output DWORD The end values for the 2 counters are stored as comparison values into the module by the user program. Both counters compare continuously whether or not their programmed end value is equal to their actual value. When the counter (actual value) reaches its programmed end value, the binary output CF of the status byte is set permanently.
Control byte X Output BYTE

Bit 0 = UP/DWN

In some operating modes, the counter can count downwards, too. If counting down is desired, the bit UP/DWN must be set to TRUE. If doing so, the counter starts counting downwards at the start value (set value) to the end value (max. from 4,294,967,295 to 0 or hexadecimal from FF FF FF FF to 00 00 00 00). After reaching 0 the counter jumps to 4,294,967,295.

Bit 1 = EN

The processing of the counter signals must be enabled. Depending on the operating mode, enabling is done via a terminal or by the bit EN = TRUE within the control byte.

Bit 2 = SET

The counter can be set to a start value (see the description of the set values for the counters 1 and 2 at the beginning of this table.

Bit 3 to Bit 7 free