Light Sequencing

Lets keep it real guys, the OP wants some guidance on writing a program with certain criteria, this is turning into a competition of who can write the smallest code and ignoring the OP's dilemma.

Really?

I could not disagree more... the OP was looking for guidance for homework, we collectively provided several options for him to look at, our normal response would of told them to "go pound sand and we dont do homework" but instead we listed several good ways of doing what they need and several ways of 'out of the box' views, not once did we talk about how long the lines are at the store or how AB is so much better than Siemens or how many people are sick from the virus.

AND... hell this is the second time someone said I was correct this year all I need is one more to beat my record and I have 7 months left.

PLCnovice61 said:
In GT's example, OP never said what the time frame could be, so he's the winner.

Thank you 🍻
 
OP's Post:
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!

This says it all, comments like throw a dummy timer & counter in is definitely not helpful in my opinion.

I know we should not do the work for them but guide them.
Rant over.
 
the OP wants some guidance on writing a program with certain criteria, this is turning into a competition of who can write the smallest code and ignoring the OP's dilemma.


I agree with the first, not necessarily the second: by playing code golf we are providing guidance to the OP.


That said, I take your point that helping has become second banana behind fun. That said, the problem is so small that any direct help would be akin to writing it for them. daba already told the OP everything they should need to know.
 
Even though I don't neceassarily agree with the judgement that we have moved off course here, here is an approach the OP should consider:


Break down the problem into easily defineable, and solvable, tasks, worry about connecting them later. What are the tasks here?

  1. turn a group of lamps on and off according to a pattern
  2. change from one pattern to the next in a sequence
  3. cause those changes to happen at regular time intervals
So we need a PLC-implementable way to represent each of those tasks. For example, item 2 - making changes that follow a sequence - is akin to stepping or counting, and PLCs have counters. So if we can store and access the different patterns by a count lookup, then we can make the PLC execute those patterns according to the .ACC parameter (i.e. the current count) a of a counter. Likewise, item 3 tells us when the count should occur: at regular intervals in time, and PLCs have timers. Can we make a timer run repeatedly by starting at zero and advancing in time until it hits timers) a preset expiry time at which point it resets to zero and starts over?
 
Yes I suppose, however, I'm mindful that the OP has now gone quiet this could be due to having solved the problem or it has got too much for him. My recent apprentice before my retirement was keen to keep learning & I have helped him out recently, I also told him to join this site as it is a good source of information, he has told me that he no longer uses this site and has gone to another (well known), he told me he found it a little patronising (not sure what that meant) and very often the threads were going off track. Just saying....
 
Drbitboy, that is exactly right, There is a problem when we try to give advice but not do the project for them, the main problem is if they have a lack of the general principles of timers/counters, logic the list goes on then it is difficult for them to understand some of the advice. There is the problem, the tutors give them a task but do not teach the basics. its like telling a bricklayer apprentice on his first week to build a garage when he has not even been taught the basics of mortar mixes etc. All my apprentices (well I call them that some just had interest and wanted to gain knowledge) I gave them quick lessons on how a basic PLC works, Introduced the functionality of the functions then told them to go away and play with them, not design a program just learn how things work. After this we would have a discussion and thrash out what they had learned and any problems they could not understand. The stages after that was what they all should learn before coding. i.e. design, functional description etc. This would always happen before they were given a task.
 
Yeah it's great the only boss I have now is the wife lol, Beware you married guys, if your due for retirement, don't think it's all sitting on the sun lounger drinking beer!. Sorry I'm hijacking this post naughty....
 
This would always happen before they were given a task.




Good point.


HEY! OP! If you're still out there?


Go watch Ron Beaufort's 90 minutes of videos, then read the help files on timers and counters, and look for examples on youtube of wherever e.g. see what The Google gives for "repeating plc timers allen bradley" - if it leads back to PLCtalk.net (and it will;)), skip any thread that does not provide an answer in the first half-dozen responses; after that it's all windbags like me. Keep at this until you understand how they work.



Note that timers and counters are actually the same thing with different motivators: the timer is driven by some kind of clock; the counter is driven by a rising edge that the PLC program - i.e. you - control (what's a rising edge? I'm glad you asked; now ask The Google).


Then, with your new-found knowledge, play around with those building blocks by themselves. Set up a repeating timer. Set up a pair of ping pong timers, where each runs and when it finishes it then starts the other. Set up a counter where you drive it manually (in RSLogix you can manually change bits in either the Data File window or by right-clicking on the bit name anywhere and selecting Toggle Bit). Set up a repeating timer where it's expiry triggers a repeating counter to increment.
 
I did it already from LD, but you mean the new-to-me SQO cat-skinner e.g. summat like this?

Yep, that'll do it, only thing is you'll need 2 scans of your STI for each time period. You'll need each alternate scan to "reset" the SQO, by seeing it is .DN, then the next scan will see it Not Enabled, and re-enable it.

My method from that post means the timebase of your STI or Periodic Task matches the time period you actually want, not half of it.
 
Yep, that'll do it, only thing is you'll need 2 scans of your STI for each time period. You'll need each alternate scan to "reset" the SQO, by seeing it is .DN, then the next scan will see it Not Enabled, and re-enable it.

My method from that post means the timebase of your STI or Periodic Task matches the time period you actually want, not half of it.


Yes I saw the half-time requirement, but I hadn't noticed the --(U)-- the first time I looked your post in the other thread. hahahahaha, very funny, and a sweet hack! I've played that game on other edge-detecting control structures, but didn't want my brother to slap me in the head.


ASF: you were right! I finally got it, I was just too thick to realize what you were hinting at was summat I had already done.
 

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,028
Hello everyone. I am working on designing a call light/alarm system I have roughly 20 stations that will each have their own call switch. Then...
Replies
20
Views
372
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
98
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
130
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
345
Back
Top Bottom