Light Sequencing

Lunaa

Member
Join Date
May 2020
Location
MN
Posts
3
I need to make a sequence of lights flash on and off in automation studios using AB PLC. I have to use timers and counters. The required sequence is attached in a pdf. Please help!
 
Welcome to the forum!


If this is a homework problem, or anything else for that matter, then the convention is for you to show your work to this point, and then folks will comment. Also stating what environment you are using would be useful (ladder, structured text, pen and paper, etc.).


But let me ask this: do you see any patterns in the sequences?
 
Last edited:
Welcome to the forum Lunaa.
Run a free resetable 1 second timer , when timer completes it resets itself and your counter is incremented by one.
Counter accumulator is your time column in your chart file.
When counter accumulator equals to 1 light a will turn on
when counter accumulator equals to 2 lights a and b will turn on and so on.
 
I am using ladder. So far I have it so it turns on 1, turns off, then turns on 1 and 2, but 1 stays on. This is what I have as of now.
 
I would do something like this... LD gave you a perfect ST version but mine is in ladder

Input 0 starts a timer, once its equal it indexes a counter, the counter ACC is moved to output word and and flashes the outputs word.

1100flasher.png
 
1) Go watch Bernie Carlton's video series: https://www.youtube.com/watch?v=T3tnXu-Eywc


That is just so you can at least understand how to put instructions and rungs together, and understand how they work. Because I see you have this


Code:
       DN    DN

...---] [---]/[---...
which is useless because it will always evaluate to False (except in edge cases on CompactLogix and ControlLogix, but Bernie will explain all that)





2) Then look at the GRT, GEQ, LES, LEQ instruction help menus, and think about comparing the .ACC parameter of a timer that runs for 12s and then resets itself: the .ACC values will be 0 for 1s; then 1 for 1s; then 2 for 1s; etc.


For a start, see if you can use the timer .ACC value to turn on lamp [a] for two seconds after each time the timer resets i.e. each time the .ACC value is reset from 12 (or 11) to zero. Don't worry about lamps b, c, and d. Just get that working. Then build from there.



Any computer program, ladder or otherwise, is a model of some piece of the world; chart.pdf is your "world," but know that you can divide that world up into different pieces i.e. sub-worlds, and control or even eliminate interactions between them.


Finally, make sure that you turn [a] on and off in exactly one instruction; do not try to set its state in more than one rung or branch.
 
I would use a start stop and reset button.

start button to start a retained timer
stop button to pause timer
reset button to reset timer.

as the value accumulates use compare instructions
IF time value GRT then 2 and LESS than 3 turn on output X and X
etc etc

when the timer reaches the end of time (12 seconds) reset the timer and the loop restarts.
 
Such a shame you have to use Timers and Counters.

So obviously a homework question...

In most A-B PLCs I could generate that light sequence, or any light sequence, of (almost) any length, using just 2 instructions.

Yes, just 2 instructions in the whole PLC !
 
Lunaa, take another look at your "timing diagram" pdf, and see if this helps you to work out a method of achieving the goal....

1, 3, 6, 12, 8, 0, 15, 0, 15, 0, 15, 0.

Can you see that those numbers are the decimal representations of the binary patterns formed in the a, b, c, d columns, where a = bit0, b = bit1, etc.

Now think of your "Time" column as a "counted" value, triggered by the elapsed time.

The question doesn't actually state what happens in the time interval from 0 to 1, so I am assuming that time=1 is the 1st period, where your "count" will be 0.

So, time = n, count value = n-1.

I don't know how advanced you are in your education into the world of PLCs, even if you have ever heard of "indirect addressing".

That is the approach I would use if I had to use timers and counters.
 
Assuming you are a real beginner then I suggest you look at it logically when do you want each light on? for example light 1 comes on at 1, 2, 7, 9, 11 so create a oneshot with the timer at what rate you want, increment the counter and reset the counter when the count value => 12, (note: this gives the effect of count = 12 all blank but it is really 0) then for each lamp rung do a compare for equals for each of the count value you want the light to come on and OR these compares for each i.e.
on lamp 1
CMP Count = 1 OR
CMP count = 2 OR
CMP count = 7 OR
CMP count = 9 OR
CMP Count = 11
OUT Lamp1
This is a long winded but flexible as you can add, take away compares for any values of the counter to light any lamp on any step not particularly good code as there is probably some algorithm in the pattern but cannot be bothered to look, IF there is and this is an assignment then it may be worth looking into to get more marks.
 

Similar Topics

Hi there, I'm having trouble with a task I was given on Siemens S7. I have to sequence one light with one PB. You press the button once, the...
Replies
22
Views
5,001
Hi Guys, I have a 1769-L24-QBFCB1 that has the OK light flashing on the embedded counter module. The manual states it is a resettable fault, but...
Replies
0
Views
38
Hi to all. On our Siemens PLC power supply, the battery light is showing amber. If we do not immediately change the batteries, will we lose the...
Replies
3
Views
125
Hi all, I have a question about light towers, the way I have always used them and the way I was taught is like indicator lights, i.e. Green...
Replies
8
Views
340
I call this "slightly off topic" because my model railroad layout is controlled by a PLC. Christmas themed trains running on the layout, one at a...
Replies
1
Views
274
Back
Top Bottom