Home AW-SYS Support Demo

 

Previous
Next

Example 21
Square wave generator

The output A2.7 should be controlled by a square wave signal with Ton = 0.5s and Toff = 1.5s.

During the first run of the ladder program, the NC contact of T2 is closed and therefore the output of timer T1 (Off-delay) is activated. Now the NO contact of T1 in path 2 is also closed and the output of T2 is activated.
On the next cycle, the NC contact of T1 is open and the time T1 begins to advance while its output remains high, leaving T2 in the same status.
At the end of the time on T1 (1.5 sec.) its output goes to low level and the NO contact in path 2 opens, timer T2 starts and begins to measure the time. Meanwhile, the output remains high.
At the end of the time on T2, the output from the timer goes to low level. We have now returned to the initial conditions and the cycle repeats itself indefinitely, as required.
The development in time of the signals for T1 and T2 is shown in the first two lines of the diagram below: whereas the third line shows the development that should take place at output A2.7. Note that this output is the complement of the signal T1 except for a small difference in time which is equal to one run cycle. This time difference has been exaggerated in the diagram for greater clarity. We conclude the third path of the program by implementing a function assigning this criteria to the output of the PLC.


Time diagram of a square wave generator

The AWL program is simply the conversion of the ladder program and at this level we consider that it should be quite easy to understand.
By suitably programming the two time constants it is possible to vary the Ton and Toff to create square waves with the different frequencies and working cycles as required.

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