PLC State Machines / Sequences

davidd31415

Member
Join Date
Mar 2010
Location
USA
Posts
3
Hi,

I am looking for basic ladder logic to create a PLC state machine or sequence. For starters I'd just like to alternate between different bits being turned one seconds after each other.

For instance, bit one on, delay one second, bit two on, delay one second, bit three on, and so on. Can someone point me to an example ladder logic code which accomplishes this?

Will I need to use a separate timer for each state or can a single timer be used?

Thanks!
 
Welcome to the forum.

Homework, eh?

A starting hint will be to use separate timers. Now, give something a try & post what you've completed and you'll get some help without actually giving you the answer. Good luck!
 
Homework? No. I studied PLCs for about two weeks back in the late 90s while working on my BSEE but it was the manufacturing engineering students who focused on them.

If you'd like to discuss the application feel free to send me a PM and I'll respond with my phone number. I'll buy you lunch if you're ever out in the Troy area. I might have some future work for you to, if you're looking.

Meanwhile, if this forum does not assist with simple questions then hopefully this thread can be deleted. I'd hate for anyone, student or professional alike, to search the internet, find this thread, and then read your response.
 
AutomationDirect provides for some of its lines a helpful add-on to the Relay Ladder Logic called Stage Programming. They have a demo version of their software (DirectSoft - limited to a fairly small 100 steps). I use Stage Programming for our machines to control specific processing steps.
 
Homework? No. I studied PLCs for about two weeks back in the late 90s while working on my BSEE but it was the manufacturing engineering students who focused on them.

If you'd like to discuss the application feel free to send me a PM and I'll respond with my phone number. I'll buy you lunch if you're ever out in the Troy area. I might have some future work for you to, if you're looking.

PM sent.

Meanwhile, if this forum does not assist with simple questions then hopefully this thread can be deleted. I'd hate for anyone, student or professional alike, to search the internet, find this thread, and then read your response.

This site is often a target for students that just want to complete the homework by having someone else provide the answers. Forum members are happy to assist the student in learning by trying to lead the student to the answers by themselves.
 
Yes, sorry if we sounded like a bunch of grumpy old codgers trying to keep people from learning anything. If you do a search of the forums for State Machines, you'll see quiute a few posts discussing them, and the various uses, ways of programming, and such.

As for something like what your doing, if your using Allen Bradley PLCs, there's the SQO function. Using that, you could accomplish what you want. I did a quick google search and came across this, which looks helpful. However, it explains the function using tags, which are only available in RSlogix5000, not 500.
 
That too, lol. This forum has HUGE amounts of knowledge available for you to search through. It is quite possibly the best place to learn about PLCs online.
 
Bobbias,

Actually I've been using DL PLCs but I'd like to be able to quickly write state machines regardless of what PLC I'm using.

Using the term SQO should help narrow my searches.

I found this book online this morning: http://webbooks.net/freestuff/plc.pdf which shows a few different state machine design examples on pages 289-298. I'll take a look at other discussions on here tonight.

Regards,

David
 
Last edited:
A common method of doing what you want is to use an integer register to enable various sections of logic as the sequence progresses.

When the register EQUals '1' say, some logic is enabled causing a machine to do something. At some preprogrammed point a condition will be met (limit switch made, timer done, etc.). When this happens a new value is loaded to the integer register thus enabling a new section of logic to accomplish the next step and disabling the previous step. Each step will have this EQU comparison - using different values, of course, to enable the various sections. This is very similar to the stage programming mentioned by bernie_carlton.

Sequential Function Charts are another form of sequencing. If you can draw out your sequence with an SFC the conversion to ladder is straightforward.

I would dissuade you from SQOs.
 
A common method of doing what you want is to use an integer register to enable various sections of logic as the sequence progresses.

When the register EQUals '1' say, some logic is enabled causing a machine to do something. At some preprogrammed point a condition will be met (limit switch made, timer done, etc.). When this happens a new value is loaded to the integer register thus enabling a new section of logic to accomplish the next step and disabling the previous step. Each step will have this EQU comparison - using different values, of course, to enable the various sections. This is very similar to the stage programming mentioned by bernie_carlton.

Sequential Function Charts are another form of sequencing. If you can draw out your sequence with an SFC the conversion to ladder is straightforward.

I would dissuade you from SQOs.

Agreed.

Sequencers can be a bear to figure out by others or even by the author at later dates. Plus, they are not necessarily transportable between plc mfgs (some plcs don't support them). In my case, customers specifically disallow them.
 

Similar Topics

A CIP request for the Identity class (0x01), Instance (0x01), yields the State in Attribute 8 (0x03 as Operational, for eg.) in its response. Is...
Replies
0
Views
473
Dear forum, I have earlier worked with RSLogix 5000 and I remember there was a function in the software that made it possible to save the current...
Replies
9
Views
2,145
Hi all, I was wondering if there’s a automatic tool that can convert a PLC written in ST, FBD, IL to state machine diagram? Thc
Replies
2
Views
1,471
Is there a way to know which is the primary and secondary chassis through gsv? I have read that "PhysicalChassis" (Chassis A/Chassis B) is an...
Replies
2
Views
2,236
Hi, ive recently just started studying Plcs as a topic within my engineering course. and im finding it extremely hard to find information about...
Replies
13
Views
5,397
Back
Top Bottom