INDUSTRIAL AUTOMATION | Describe working of up/down counter.

 Up/Down Counter:

Count up and down instruction is used to increment and decrement the count value at the CV output. If the signal state at the CU input changes from 0 to 1(positive signal edge), the current count value is incremented by one and stored at the CV output. If the signal state at the CD input changes from 0 to 1(positive signal edge), the count value at the CV output is decremented by one. If there is a positive signal edge at the CU and CD inputs in one program cycle, the current count value at the CV output remains unchanged. 

The count value can be incremented until it reaches the high limit of the data type specified at the CV output. When the high limit value is reached, the count value is no longer incremented on a positive signal edge. When the low limit of the specified data type is reached, the count value is not  decremented any further.

When the signal state at the LD input changes to 1, the value (count value) at the CV output is set to the value of the PV parameter. As long as the LD input has the signal state 1, the signal state at the CU and CD inputs has no effect on the instruction. The count value is set to zero when the signal state at the R input changes to 1. As long as the R input has signal state 1, a change in the signal state of the CU, CD and LD inputs has no effect on the Count up and down instruction.

You can scan the current status of the up counter at the QU output. If the current count value is greater than or equal to the value of the PV parameter, the QU output is set to signal state 1. In all other cases, the QU output has signal state 0. 

One can also specify a constant for the PV parameter. One can scan the current status of the down counter at the QD output. If the current count value is less than or equal to zero, the QD output is set to signal state 1. In all other cases, the QD output has signal state 0. 

Post a Comment

0 Comments