Setting the limit value for counters

This step shows how you can set a limit value in TwinCAT from which the counter value is automatically reset to zero. When counting upwards, the counter value is reset to zero when the limit value is reached. When counting downwards, the counter value is reset to the set limit value when zero is reached.

Proceed as follows:

1. Click the CX7028 device on the left in the structure tree.
2. Click the CoE-Online tab.
Setting the limit value for counters 1:
3. Double-click the CoE object 8000:12 Counter reload value and set the limit value.
4. Then double-click the CoE object 8000:09 Enable reload and set the value to True.
The function is only active when Enable reload is set. Alternatively, the latch input can be used and the counter value can thus be reset externally. To do this, the latch function must be disabled and the CoE object Enable extern reset set to True. With this setting, the current counter value is set to zero on a high level at input 3.
Setting the limit value for counters 2: