Home AW-SYS Support Demo

 

Previous
Next

Example 28
Sequential lights in 4 channels

Configure the 4 channel sequencer shown in the following function diagram.


Functional diagram for a 4 channel sequencer

The diagram shows the lighting sequence for lights connected to four channels. The black circles show that the channel has been activated at that particular step. As can be seen, channel 0 is active during step 0, channel 1 during step 1, and so on. If the lights are placed in a line the effect would be a movement of the light source from one end to the other and then back again.
Step 5 is followed by step 6 which is identical to step 0, and then another identical to step 1. The lights follow one another cyclically. If the line was cut and then rolled to form a cylinder where the opposing limits of step 0 and 5 coincide, then the effect would be similar to the drum of a music box: when the tune reached the end it would begin all over again.
Continuing with our musical example, a music box plays its tune using a cylinder with levers suitably distributed to one side and a mechanism that makes it turn.
Our starting point will be this mechanism. The mechanism for advancing our sequencer will be a pulse train with a period of 0.2 seconds, that is a time base with a period selected arbitrarily. The statements
UN -TIMER
L KT20.0
SA -TIMER
create an pulse train, as seen in Example 16. The cylinder will consist of a counter which will begin at 0 and count forwards on each pulse.
UN -TIMER
ZV -COUNTER
When the value reaches 6, that is after the last step, it should reset itself to the starting value of 0. Furthermore, step 6 should be identical to step 0.
L -COUNTER
L KF+6
! = F
R -COUNTER
Before distributing the levers on the cylinder, identify the sections of the cylinder that correspond to each specific step. The statements
L -COUNTER
L KF+0
! = F
= -STEPO0
The following groups of statements program the merkers corresponding to each of the other steps. A different merker will be active every 0.2 sec. after STEPO0 to STEPO5 and then beginning again from STEPO0.
Now that we have identified the positions we can insert the levers. Beginning with channel 0 and observing the lighting sequence once again. Channel 0 is only active during step 0:
O -STEPO0
= -CH0
Channel 1 should be active during step 1 as well as during step 5:
O -STEPO1
O -STEPO5
= CH1
Continue this process for the other two channels until completing the music box, or if you prefer, the sequencer.
In this example it is possible to increase or decrease the duration of the steps by changing the constant loaded into the timer and producing the effect of changing the speed of the apparent movement of the light source. It is also possible to change the number of steps by varying the constant used to reset the counter and adding other values to differentiate the new steps. The sequence of the lights can also be changed by modifying the conditions in the OR groups included in the last part of the program.

The solution presented here is, of course, not the only way of resolving the problem. In general, the more complex the problem, the greater the number of possible solutions. Possibly it is not even the best in terms of versatility, simplicity, programming maintenance or elegance, the next example responds better to these requirements, but it is the simplest approximation using the most common statements that we have been able to create, and this is a basic requirement of the task before us: help you to take your first steps in the world of PLC programming.

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