Sequential Function Charts vs Ladder Logic in Studio5000

All too often posts on this forum seem to lump the quality of and editor and the quality of a language together.
Not to mention the quality of the programming on top of that. Bad code is bad code no matter what language it's in.

I've seen SFC code that is impossible to follow. The sequence is so complex and so broken up that you open up the screen and it's all just a bunch of arrows. At that point, all the benefits of SFC are out the window.
 
A lot of arrows may be an indication that someone did not spend enough time thinking with pen and paper before they started typing sfc code.
 
I asked this question to one of the wizards that showed me the ropes many moons ago.

His statement has rung true ever since.

If you have a service department, and want to sell a service contract, make that code as convoluted as possible.
If you don't have a service department, and do not want to fly out to nowhere's ville, make it straight forward so the minions at that facility can fix their stuff.

SFC/Ladder, depends on how many 2 am calls you want.
 
Just my two cents.

Move Equals statements for sequencing in ladder logic is the way to go.
----------------------------------------------------------------------------------------------------------------------------------
(Starting)
[0 Equ SequenceTagA]-----[check start function]--------------------[10 Mov SequenceTagA]
(Sequencing)
[10 Equ SequenceTagA]-----[Do function]-----[check function]-----[20 Mov SequenceTagA]
[20 Equ SequenceTagA]-----[Do function]-----[check function]-----[30 Mov SequenceTagA]
(Multiple Possibilities)
[30 Equ SequenceTagA]-----[Do function]-----[check function A]-----[40 Mov SequenceTagA]
| |--[check function B]-----[140Mov SequenceTagA]
(Starting other processes)
[40 Equ .SequenceTagA]-----[HandShake SequenceTagB start]-----[Confirmation of HandShake SequenceTagB starting]-----[50 Mov SequenceTagA]
(Ending)
[140 Equ SequenceTagA]-----[Do function]-----[check function]-----[0 Mov SequenceTagA]
----------------------------------------------------------------------------------------------------------------------------------
I have seen this and done this in the past... Its the only sequencing I'll ever use again.

  • If you need to add steps, its stupid simple. (Make sure you gap your minor steps and major steps ex. 10, 20 , 30 1000, 2000, 3000)
  • If the machine gets stuck on a step its stupid simple to troubleshoot.
  • You can start other processes and handshake with them that they got the ok to start easily.
  • If you have different sequences that may happen depending on the check function, you can just re-route it to a different step easily.
  • If you need to stop the machine for troubleshooting purposes, you just throw an AFI in the step.
  • If you put an MCR at the top and the bottom of the sequencing, then you can stop the sequence where its at if a safety gets tripped or door gets opened (Not always as planned though). This can keep the step sequence from inadverntly getting sequenced while people are working on the machine and flagging sensors. ( I caution with this hint, because a lot of times its just better to start over on the sequence)
  • You can put a sequence structure on the HMI and just look at what value your sequence tag is to find out what step your on.
Everyone does things differently, but I have seen some serious Automation happening with this type of sequence structure, and when downtime could potentially be $500/min. - $1,000/min. You want to be able to figure out exactly where things are stopping and you want to know right now. You just have to find the sequence tag and see what the value is to find out what step your on. (Obviously not always this simple)

SFC is ok, but I am in agreement that it sucks to do changes. You can look at that as a good thing or a bad thing depending on who will have access to the logic.
 
You should go with Ladder in my opinion, as its the most widely used and understood language. Especially for techs in the middle of the night.

Make it as well commented and documented as possible, standardize, train your people, and your off to the races.
 

Bit_Bucket_07 - +1​


SFC - not if i can help it, not in my plant !
i had a company write a sfc program for a press on a what i would estimate to be a 300" tv (no i am not joking !)
now, put that program on a 15" screen. in the opposite corner.
you had to zoom in over 12 times to find the starting point, then try to find the next step.
where it it??? in the opposite corner, now find the next step !!!!
commands on top of commands on top of commands on that 15" monitor.
now do you see why i hate them.

ALSO,

most maintenance people know and understand ladder logic.
if they can't understand sfc, structured text, function blocks, grafcet, then the machine won't run!
Good ladder logic that's easy to follow, good rung comments and instruction manuals with detailed sequence of events will go a long way.
i currently struggle with structured text, no comments, written in another language, no documentation explaining tag / sensor names.
the guy wrote the program for job security. don't put your maintenance workers in the position i am in.
it takes an hour or more to find what you are looking for that should have only taken 20 minutes.

james
 
The SFC haters are nuts. One of the things we encourage our customers to do when they have a problem is to add the step number to the trend or plot. This way one can see the transitions that happen faster than what you can see on a ladder. If necessary the values that determine the transition between steps can be included in the trend. This gives one the capability to see what is happening over a period of many seconds. In addition, the RMCTools have the ability to act like a scope and use an event to capture so many seconds before and so many seconds past the event. This makes capturing spurious things easy.
The down side is that I doubt PLCs can capture trends at fine time increments.

The trigger on event makes it so one can set this up and wait for the spurious even which may happen rarely like every few hours or days.
 
I asked this question to one of the wizards that showed me the ropes many moons ago.

His statement has rung true ever since.

If you have a service department, and want to sell a service contract, make that code as convoluted as possible.
If you don't have a service department, and do not want to fly out to nowhere's ville, make it straight forward so the minions at that facility can fix their stuff.

SFC/Ladder, depends on how many 2 am calls you want.
So which one will get you more 2am calls?
Is it SFC because Electricians cannot read it?
 

Peter Nachtwey,​


yes, i may be nuts. i have had very little training with sfc and my first experience is with that big program crammed into a 15 " screen.
in addition, no maintenance tech at the plant or former plant knows sfc, structured text.
if it were a simple program that would go down the line like ladder or fit on a 15" screen, i might change my opinion.
but with no training and no one else here that knows sfc or structured text, i still don't want it to be allowed, but they keep buying the equipment with structured text / sfc and i have to deal with a program written for job security.
we have several machines with structured text written with no documentation as to what the tags are or what is happening.
haven't dug into the sfc part yet.
james
 
I have unfortunately been exposed to SFC a number of times, the one I really remember was a mildly complex program written by others, the original programmerr was called in to make a couple of modifications, I do not doubt his experience, however, he did struggle a little, I could see the frustration on his face, after he left, there appeared to be some problems, I spent a lot of time trying to sort it out, I did get it working, however, some months later there was a request that in the future a new mod was required, the company that did the original & the last mod told us that the engineer was currently in India & would not be availlable for another 6 weeks, I was tasked to do the modifications, after spending a number of hours doing the mods & simulating it I decided it would be quicker to re-write it using a sequence word, it took me about 2 days based on the fact that the logic for the original steps was sound & re-used it, never looked back after that, made a number of changes in the sequences over time & probably never spent more than a couple of hours each time.
I have no doubt tha SFC has it's place but not for me. Indeed another piece of plant also was written in SFC & worked fine, I was tasked with data capture using a small scada system to populate an SQL DB, & knowing there was going to be some sequence changes in the future I re-wrote the code & never looked back.
 
So which one will get you more 2am calls?
Is it SFC because Electricians cannot read it?
electricians can't read, monkeys with hammers don't listen.
My vpn connection is set to a hot key.

I prefer ladder logic over SFC, just my preference.
I get calls all hours of the night, 99% of the time someone did something and tried to blame it on "the code must have changed"......Code doesn't change!!!
 
electricians can't read, monkeys with hammers don't listen.
My vpn connection is set to a hot key.

I prefer ladder logic over SFC, just my preference.
I get calls all hours of the night, 99% of the time someone did something and tried to blame it on "the code must have changed"......Code doesn't change!!!
I have a palletizer with a 5/02 that I setup in 1992, they always blame the code, it's never the code, code has not changed since I installed it.
 

Similar Topics

Recently I had to troubleshoot a PLC-5/40 ladder logic kluge consisting of latches, interlocks, summations, redundancies, and confusing...
Replies
6
Views
3,294
Hi, is it possible to read the name of the steps in an S7 Graph sequencer? In the parameterinterface there is, for example the parameter #S_NO...
Replies
21
Views
8,373
hello I am using a SFC function with rslogix and my question is: if Step 4 or 10 is currently activ how can I reset (or abort) all SFC and go...
Replies
5
Views
5,817
I'm working on my 61131-3 knowledge for some up-coming projects, and there is an automated saw on the list that would probably be the perfect...
Replies
11
Views
4,475
Hi, I am programming a process in SFC. Does anyone know what the function of the DN bit does? In my manual it reads that it signals when the...
Replies
5
Views
3,280
Back
Top Bottom