|
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.
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).
More examples: |