Sign in to follow this  
Followers 0
brianafischer

How To Create A Sequencer With Same Actuation for Step?

24 posts in this topic

I am not sure why I haven't been able to figure out a graceful way of doing this without timers. I am creating a ladder logic program where a push button is the trigger to move to the next step in the sequence. I am trying to avoid using timers and integer files for the sequence, and stick with the traditional latched states. However, I am having a heck of a time finding out how to prevent all of the subsequent states from becoming true as soon as the first state does. Any clever tricks would be appreciated. Thanks, Brian

Share this post


Link to post
Share on other sites
It's late on Friday, but here's a quicky without much thought. You want to use a PB to step through a sequence. I would use a counter myself. But try this anyway. Put a one shot on push button, so that it's only true for one scan. Put your steps in reverse order in the ladder. So that once a step is activated, the following step will not be evaluated until the next scan. Step 1 will be at bottom, step 2 above step 1, etc...

Share this post


Link to post
Share on other sites
I came across this problem alot and my solution is to .... ... are you ready ... With a one shot at the top, put the rungs in reverse order. Edited by Spedley

Share this post


Link to post
Share on other sites
When I first read this I thought of using a one shot on the PB and a sequencer to move from step to step. But reading the other postings I must say that a one shot counter would probably be more elegant. pro of the sequencer you could list rungs in Step 1 thru Step X order while with the counter you might have to put them in X thru 1 order. Edited by BobLfoot

Share this post


Link to post
Share on other sites
I was actually thinking of something along the lines of that, but I really attempt to stay away from logic in which changing the order of the rungs effect the operation of the entire routine. That type of code often returns to haunt me in the form of phone calls from maintenance/upgrade calls. As far as using a counter, are you referring to looking at the ACC value to active a specific rung? A screenshot/logic line would be helpful! Any clever tricks using just XIC/XIO/OTL/OTU/ONS? I know there has to be a few out there!

Share this post


Link to post
Share on other sites
I've written a good deal of code for controlling simple machines using sequencers. I'll give you the just of the code in mnemonic listing. Tags which must be replaced by data file elements are in italic Bold. Rung 1 - Sequencer Initialize and Reset SOR BST XIC First_Scan NXB XIC End_Sequence_Bit NXB XIC Sequencer_Reset_Pushbutton BND MOV 1 Sequence_Integer EOR Rung 2 - Pushbutton Deboune Rung using One Shot SOR XIC Pushbutton_Input ONS One_Shot_Bit OTE PushButton_One_Shot EOR Rung 3 - Sequencer Advancement Control Rung SOR BST XIC Sequence_Integer.Bit_0 XIC PushButton_One_Shot NXB XIC Sequence_Integer.Bit_1 XIC PushButton_One_Shot NXB XIC Sequence_Integer.Bit_2 XIC PushButton_One_Shot NXB XIC Sequence_Integer.Bit_3 XIC PushButton_One_Shot BND MUL Sequence_Integer 2 Sequence_Integer EOR Rung 4 - Step 1 Execution Logic SOR XIC Sequence_Integer.Bit_1 Your Logic is written here EOR Rung 5 - Step 2 Execution Logic SOR XIC Sequence_Integer.Bit_2 Your Logic is written here EOR Rung 6 - Step 3 Execution Logic SOR XIC Sequence_Integer.Bit_3 Your Logic is written here EOR End of program. hope this gives you enough to expand your logic. Important to note that rung order does not matter for the execution rungs. The PushButton_One_Shot can be replaced by a timer_done or a sensor_input for changing from one step to another. And in this example End_Sequence_Bit is equal to Sequence_Integer.Bit_4 Edited by BobLfoot

Share this post


Link to post
Share on other sites
dang, I was beaten to it!P.S. If I write D-A-M-N I don't expect it to be changed to dang ! Edited by Spedley

Share this post


Link to post
Share on other sites
You got to type fast to beat those guys in Northwest South Carolina

Share this post


Link to post
Share on other sites
It doesn't matter who's first, the way I see it, we just re-enforced each others solution.

Share this post


Link to post
Share on other sites
Seems to me there is an age old addage "In Many counselors there is Wisdom". Well we could modernize that to "At MrPLC there is PLC Wisdom".

Share this post


Link to post
Share on other sites
Speaking of age, it looks like you've aged quite a bit in the past few days. Where did that long grey beard come from? A sign of wisdom or are you the new MrPLC wizard?

Share this post


Link to post
Share on other sites
Those big beards are the place to stash extra fuses, wire ties, jumpers etc...

Share this post


Link to post
Share on other sites
LOL!!! Now that was a good one Ken 5 points for you Well looks like an IOU for points again Edited by TWControls

Share this post


Link to post
Share on other sites
Just remember BobLfoot the gray is no more since fighting the big monster of 13.* KV I am now BobLfoot the White. LOL And yes Ken the beard is great for fuses and password files.

Share this post


Link to post
Share on other sites
Your knowledgeable post show your wisdom so I don't care if your if your hair is gray or white. I give you 5 points too

Share this post


Link to post
Share on other sites
Thank you and perhaps the newer avatar will end the grey/white debate.

Share this post


Link to post
Share on other sites
And a few food scraps to nibble on for those late nights when you are sitting there programming and all the take out shops are shut.

Share this post


Link to post
Share on other sites
Didn't think about that, maybe I should grow a beard

Share this post


Link to post
Share on other sites
If you ever grow the beard don't work in the food industry. The beard Nets are hot and a real pain/

Share this post


Link to post
Share on other sites
I like to latch my steps so if the sequence hangs of an unknown reason you can easily see where it stops.

Share this post


Link to post
Share on other sites
I understand why it helps to debug to latch the step. The sequencer I posted also maintains the step bit so that it can be debugged when it hangs. Unless you and I define latching differently. Edited by BobLfoot

Share this post


Link to post
Share on other sites
For this type of process I would be inclined to use a timer on the pushbutton... not to alter the way the logic functions, but purely to stop some twit accidently pressing the button twice.

Share this post


Link to post
Share on other sites
Good Point Snerkel. I did one shot the Pushbutton to keep it from firing again and again, but an anti-recycle timer of 2 to 5 seconds would probably be a great addition.

Share this post


Link to post
Share on other sites
I liked what was posted very much as well as all the knowledgeable info I receive here at this sight. As for myself my trademark is a BSL that works very much like the counter. Many like a SQO or a SQL and a SQO. I always looking forward to all the replies and like to occasionally reply as well. Please forgive me for poor wording

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0