Home AW-SYS Support Demo

 

Previous
Next

Example 19
Counting the amount of time an input is closed (in seconds)

Determine how many seconds input E0.5 remains closed and use input E0.6 to set the timer to zero.

In the first place it is necessary to create a one second clock, that is an pulse train with this period. It is then necessary to count the number of pulses of the base time generated while the input is closed, that is the instants when the input and the pulse are true at the same time.


Diagram of the timer for closure of an input

Path 2 of the ladder diagram implements the pulse train with a period of 1 second, as we have already seen in example 16. In path 1 note that the input ZV of the counter is controlled by the logical combination AND (series of contacts in the diagram) between input E0.5 and the pulse train, that is, exactly the pulses to be counted. On the other hand, a contact of E0.6 controls the reset input to the counter, repositioning the count to zero as required.

In the AWL program, the first group of statements increases the counter corresponding to the rising edge of the AND between E0.5 and the pulse train generated by T3 in the second group of statements. The last group resets the counter corresponding with the rising edge of input E0.6 (closure of the respective contact).
The count value of Z5 represents the number of seconds during which the input has remained closed, with the limit of 999 inherent to counters in this PLC.

More examples: 1 ] 2 ] 3 ] 4 ] 5 ] 6 ] 7 ] 8 ] 9 ] 10 ] 11 ] 12 ] 13 ] 14 ] 15 ] 16 ] 17 ] 18 ] [ 19 ] 20 ] 21 ] 22 ] 23 ] 24 ] 25 ] 26 ] 27 ] 28 ] 29 ] [ List ]
More PLCs examples: Not still available