AH500 Programming Manual The 32-bit general-purpose addition/subtraction counter: 1. Setting range: -2,147,483,648~2,147,483,647 2. The switch between the 32-bit general-purpose addition counters and the 32-bit general-purpose subtraction counters depends on the states of the special auxiliary relays SM621~SM684. For example, the counter HC0 is the addition counter when SM621 is OFF, whereas HC0 is the subtraction counter when SM621 is ON. 3. Users can use either the constant or the value in the data registers as the setting value of the counter, and the setting value can be a positive or a negative.
If users use the value in the data registers as the setting value of the counter, the setting value occupies two consecutive registers. 4. For the general-purpose counter, the current value of the counter is cleared when there is a power cut. If the counter is the latched one, the current value of the counter and the state of the contact before the power cut will be retained. The latched counter counts from the current value when the power supply is restored. 5. If the counter counts up from 2,147,483,647, the next current value becomes -2,147,483,648. If the counter counts down from -2,147,483,648, the next current value becomes 2,147,483,647. Example: 1.
X10.0 drives S621 to determine whether the counter HC0 is the addition counter or the subtraction counter. 2. When X11.0 is switched from OFF to ON, the instruction RST is executed, the current value of the counter HC0 is cleared to zero, and the contact is switched OFF. 3. When X12.0 is switched from OFF to ON, the current value of the counter increases or decreases by one. 4. When the current value of the counter HC0 changes from -6 to -5, the contact of HC0 is switched from OFF to ON. When the current value of the counter HC0 changes from -5 to -6, the contact of HC0 is switched from ON to OFF. 5.
If users use the instruction MOV or ISPSoft to transmit a value bigger than the setting value to the current value register HC0, the contact of the counter HC0 will be ON and the current value will become the same as the setting value next time X12.0 is switched from OFF to ON. 2-48