In PLC programming, a counter is an instruction used to count the number of occurrences of specific events based on input signal transitions. A counter operates by detecting a rising edge—that is, when an input bit changes from OFF to ON (low to high). Each time this transition occurs, the counter either increments or decrements its present value (PV) by one, depending on the counter configuration.In Delta PLCs, two types of counters are commonly used: low-speed counters (e.g., CNT) and high-speed counters (e.g., DCNT).A low-speed counter functions as an up counter only. It increases the present value by 1 each time a valid input signal transition is detected.A high-speed counter, on the other hand, supports both up and down counting. The counting direction is determined by the status of specific auxiliary memory bits.Counting up means the counter adds 1 to its current value, while counting down subtracts 1. The preset value (SV) is the threshold value that, when reached, causes the counter's output contact to turn ON.High-speed counters are particularly useful in applications where inputs change rapidly, such as from encoders or pulse-generating devices, ensuring accurate counting without being affected by the PLC scan time.
Delta AH Series PLCs support two types of counters: low-speed and high-speed counters.
Low-speed counters are assigned to specific addresses such as C0, C1, C2, and so on. Here, the letter 'C' denotes a counter, and the numerical part specifies the unique device address.
High-speed counters are assigned to addresses such as HC0, HC1, etc., where 'HC' indicates a high-speed counter. Each counter must be properly addressed to function correctly within the PLC program.
Both AH and AS Series PLCs support low-speed and high-speed counters. The available ranges are as follows:
Counter Range in AH Series PLC:
Counter Range in AS Series PLC (AS200 / AS300):
The CNT instruction is an up counter used in Delta AH and AS Series PLCs. It increments its present value when the EN (Enable) bit changes from OFF to ON. Each rising edge of the EN bit increases the value by 1. Counting continues until the present value equals the preset value (SV); once this condition is met, further EN transitions have no effect. To reset the counter, a reset coil is used with the same address as the counter. The counter number (e.g., C0, C1) also acts as its status bit—when the present value reaches the SV, the counter bit is set to ON (1), which can be used in other logic instructions such as contacts or coils.
The DCNT instruction is a high-speed up counter used in Delta AH and AS Series PLCs. It is addressed using special high-speed counter addresses such as HC0, HC1, HC2, and so on. DCNT functions similarly to a standard counter but is capable of processing high-frequency signals. It increments its present value by 1 each time the counter input bit (EN) changes from OFF to ON. This fast response makes it ideal for applications that require accurate pulse counting, such as encoder feedback or high-speed input detection. The counter stops incrementing once the present value reaches the preset value (SV). A reset coil with the same address is used to reset the counter. The counter address also acts as a status bit, which turns ON when the SV is reached and can be used in other parts of the program.
The DCNT instruction can operate as a high-speed down counter in Delta AH and AS Series PLCs. This mode is enabled by turning ON specific special auxiliary relays (SM bits) associated with the counter. The operation of the DCNT as a down counter depends on the state of these SM bits. When the corresponding auxiliary relay (e.g., SM621 to SM684) is set to ON and the counter input bit (EN) transitions from OFF to ON, the current value of the counter is decremented by 1.
The auxiliary relay address is mapped according to the counter number. For example:
DCNT down counting is especially useful in applications where reverse pulse tracking or decrementing operations are needed, such as counting parts being removed or reverse encoder movement. Like the up counter, DCNT stops counting when the present value reaches the set value, and the reset coil is used to clear the count and status.