Handling Stops & Resets in Sequential Programming

One of the most-used methods of implementing a "state-sequencer" is to use a numerical sequencer, based on the value in a "step" or "state" register.

The "Step" number is unique, totally visible, and cannot be ambiguous.

Spare "steps" are easily implemented at design time, to allow for future modifications.

On any "step", you simply need to program a rung of code that tests the conditions that allow the step number to increment (i.e. goto next step) or you can force a new step number

I've even seen applications where the "step number" displays the relevant step action (from the functional spec.) on the HMI or SCADA as an aid to debugging.

IMHO using a numerical step sequencer is easier to understand than using a sequencer based on bit logic.
 
Thank you very much everyone for the advice on this matter.

So in summary, IANT and DABA you are both saying that the best way to program a sequence or process is to use a register to hold the step number. Then simply use a numerical value for each step number, incrementing this number at the end of each step. A COMPARE instruction can then be used to activate each step.

Then in terms of timers, ascertain on a case by case basis whether the timer needs to be retentive or not.

Thanks again.
 
Thank you very much everyone for the advice on this matter.

So in summary, IANT and DABA you are both saying that the best way to program a sequence or process is to use a register to hold the step number. Then simply use a numerical value for each step number, incrementing this number at the end of each step. A COMPARE instruction can then be used to activate each step.

Then in terms of timers, ascertain on a case by case basis whether the timer needs to be retentive or not.

Thanks again.

I also agree, I use a similar philosophy using compares and moves. I started out using latching sequences, but using this method was a complete revelation and I now only use latching sequences on simple PLC's.

Overall it gives you a lot more flexibility being able to jump around a bit more in the sequence. I also incorporate a step timer and watchdog philosophy using 2 timers for the overall sequence that can be used to slow down each step, introduce delay steps and also jump to recovery steps in the event that a step doesn't complete within a determined time. It's also useful for displaying step status information on HMI's.

Cheers,

Lee
 
Last edited:
you can also use the greater than or equil to and less than or equil to.
commands to keep items running between sequence steps
 
IMHO using a numerical step sequencer is easier to understand than using a sequencer based on bit logic.


Completely agree! All of my sequences are integer based and it is an extrememly easy and powerful method for controlling sequences. Opens up all kinds of powerful techniques for alarming, messaging, stepping, pausing, reversing, etc. I can't stand bit sequences anymore. I was forced to do it that way a couple projects ago and it was like being sent back to the dark ages.
 
I have always used bits latch/unlatch, but I'm thinking on trying the numerical steps.

Just a question, what do you use when you have a paralell branch?
A second register/word?
 
Thanks again everyone for the replies. One final question (I promise!!!!). For you guys who are programming all of the time, is ladder logic pretty much obsolete nowadays for programming complex sequences? Have most programmers moved away to Sequential Function Charts for this type of stuff or would it depend on the type of programming software being used?

To be honest I haven't really done much with SFC's in the past Is it hard to get the hang of?
 
Long Live Ladder. I have seen one utilization of SFC in a PLC-5 many years ago. I didn't have to troubleshoot it, just studied it as a curiosity.

I like ST and FBD when I get the chance to work with them, but more for process control or data manipulation. For controlling sequences and digital outputs, ladder still rules the roost at least from my perspective in the middle of the USA.

I don't think SFC is widely used.
 
Well, I use Allen Bradley almost exclusively, ladder logic is still the way to go for me.

It really depends on your platform.
 
Thanks again everyone for the replies. One final question (I promise!!!!). For you guys who are programming all of the time, is ladder logic pretty much obsolete nowadays for programming complex sequences? Have most programmers moved away to Sequential Function Charts for this type of stuff or would it depend on the type of programming software being used?

To be honest I haven't really done much with SFC's in the past Is it hard to get the hang of?

No absolutely not! Ladder IMHO is still the easiest form to write and for the average sparkie to debug. I wouldn't use anything else.
 
Ladder Logic will never be out of date
it was needed in the relay logic days
AND
I Challenge anyone to hard wire a machine using SFC(y)
 
The beauty of ladder is you can look at a network and have almost an instantaneous understanding of what it is meant to do. It allows you to quickly hone in on the specific area of interest by excluding branches of logic that are not active. It is both a program and a visual diagram. I don't see it going anywhere anytime soon.
 
The beauty of ladder is you can look at a network and have almost an instantaneous understanding of what it is meant to do. It allows you to quickly hone in on the specific area of interest by excluding branches of logic that are not active. It is both a program and a visual diagram. I don't see it going anywhere anytime soon.
... which is why I scratch my head when I read these trade magazines with articles by so-called "experts" who claim that PLCs and ladder logic are being universally replaced by PC-based control systems. Huh?
 

Similar Topics

I am trying to get Codesys to work with a couple of Moxa ioLogik E1200 series DIO devices (E1210 and E1211). I am able to write to the E1211 DOs...
Replies
2
Views
177
The objective: Reach about 10’ horizontally into a 1300F furnace, and pick up a 140lb rectangular container, then pull the container back out of...
Replies
15
Views
1,879
Hello All, I don't so much have a problem more my OCD. I have a project, with over 1000 alarms. I create arrays in the PLC/HMI for my alarm...
Replies
0
Views
566
I hope somebody might be able to help me who has done some IO-Link messaging using an S7-1500 (TIA Portal 17) and the CMx8 IOLink module for the...
Replies
11
Views
1,796
Just a little bored, so I thought I would start a thread in one way of using recipes in batching processes, I'm aware there are probably many ways...
Replies
0
Views
591
Back
Top Bottom