Chapter 2 Devices counters depends on the states of the special auxiliary relays SM621–SM684. For example, the counter HC0 is an addition counter when SM621 is OFF, whereas HC0 is a subtraction counter when SM621 is ON. 2. You can use either the constant or the value in the data registers as the counter setting value, and this setting value can be positive or negative. If you use the value in the data registers as the counter setting value, this setting value occupies two consecutive registers. 3. For the general-purpose counter, the current value of the counter is cleared when power is lost.
If the counter is 2_ latching, the current value of the counter and the state of the contact before loss of power is retained. The latched counter counts from the current value when power is restored. 4. If the counter counts up from 2,147,483,647, the next incremental value is -2,147,483,648. If the counter counts down from -2,147,483,648, the next incremental value is 2,147,483,647. 32-bit high speed addition/subtraction counter Refer to the instruction description of API1004 DCNT in DVP-ES3 Series Programming Manual for more details. Example: 1. X10.0 drives SM621 to determine the counting direction (up/down) for HC0. 2.
When X11.0 changes from OFF to ON, the RST instruction is executed and the PV in HC0 is cleared to 0 and its contact is OFF. 3. When X12.0 changes from OFF to ON, PV for HC0 will count up (plus 1) or count down (minus 1). 4. When PV in HC0 changes from -6 to -5, the contact HC0 changes from OFF to ON. When PV in HC0 changes from -5 to -6, the contact HC0 changes from ON to OFF. 2-49