Which programming method is better - ladder logic or structured text

Yes good structure and convention will make any language shine. It is AMAZING what some people will do to a simple ladder logic rung.

We should have a hall of fame on here for bad logic, would be good for some laughs.
 
From my humble opinion as a very newbie in the ST programming scene I find ST suitable depending for what.

I've today started with following a tutorial about ST programming. The first thing I've notice is that it becomes a true p*** in the **** when for instance in the ControlLogix plattaform , if you want to get rid of the mouse, you have to press a combination of keys like CTRL+W, CTRL+SPACE, and the TAB key each time you want to go along the way adding new definitions of tags. So finally I can't see any real advantage on using exclusively my laptop's keyboard without mouse-clicking.

This is so far the perception I'm having about easyness to use with this programming method after 1 hour.

Instead, if you have already defined the tag definitions before starting to program it might be a different thing.

This is just my humble opinion.
 
ST or LAD

Hi,

I once was an electrician in the maintenance department. Thanks to evening classes I got my graduate in Electro-Mechanics. I'm still doing evening classes in Industrial-Informatics now.

I've learned a lot in those 8 years, also the different languages, and mostly thanks to trying, analyzing other company's their code, thanks to PLCS.net.

I started with LAD, because every electrician is able to monitor in LAD. It was also a must in the beginning, because my collegue was their long before me. So I used LAD, but after several years and seeing other programmers, I learned the advantages of STL. So I begun to write more and more in STL.

If I look at programs that I did in the beginning, calculations in Lad with temps between the conversions, OH MY GOD.
The funny thing is that my (ex)-collegue is still using his old method because he is used to it (and loves the mickey mousing). Sometimes he has giant networks that are also very weird to a maintenance dude.

Now I work in the machine building industry. We use a lot Graph, LAD and SCL (ST).

I use LAD mostly for calling FC's and FB's, if they have IN and OUT parameters, then it's a handy thing to monitor this in LAD.

STL for all kind of alarms, calculations, ...

Stepping programs in Graph (grafcet).

FBD= more a language for people who think in a digital way, I don't think like that so I don't use it.

SCL, I used this for buffering data in arrays. can be very short in SCL, a for next loop is superb, in stl you have to program too much for this.


It's best to know all the languages, and use what you need. It's better to know it and not using it then not knowing !!
 
RichBlunt said:
Yes good structure and convention will make any language shine. It is AMAZING what some people will do to a simple ladder logic rung.

We should have a hall of fame on here for bad logic, would be good for some laughs.

Careful, Someone might post one of your programs! :)

That aside I just worked on 4 PLC's that were an absolute nightmare, IMHO. There was the appearance of structure but they were impossible to follow, all written by the same programmer. I can't stress enough KISS. It shouldn't take 20 minutes to find where and which fault is active.

Don
 
I would say to use ladder for the maintenance guy, and for the 'fancy' stuff write your own blocks if required, but fully document them so the next guy knows what they are doing, even if they are considered to be a 'black box'.

Cheers
 
I work as an maintenance electrician in an industry, and have some PLC experiance. Have done some small programs etc. Mostly in Siemens.

My opinion is that if i is possible you should use LAD/FBD. My first thougt when I see a new program on our machine where almost everything is written in STL, is that maby this person can write advanced programs. But he is NOT a good programmer!

You should not program a fancy program and just deliver it to somemone. It should also be easy to search for fault in it. Most electrcians are not expert programmers...
 
hmm

Hmm, what you say is true, but you only think for your situation now. Calculations, scaling of analogue values, etc..., I don't think it's a good idea to write everything in LAD.
Btw, programmers that work for other company's do have the time pressure, deadline's, when we calculated 150 houres to program code, then I will not write in LAD just because the electriciens should be able to figure it a little out.

I'm a bad programmer :unsure:


PontEL said:
I work as an maintenance electrician in an industry, and have some PLC experiance. Have done some small programs etc. Mostly in Siemens.

My opinion is that if i is possible you should use LAD/FBD. My first thougt when I see a new program on our machine where almost everything is written in STL, is that maby this person can write advanced programs. But he is NOT a good programmer!

You should not program a fancy program and just deliver it to somemone. It should also be easy to search for fault in it. Most electrcians are not expert programmers...
 
Last edited:
Combo said:
Hmm, what you say is true, but you only think for your situation now. Calculations, scaling of analogue values, etc..., I don't think it's a good idea to write everything in LAD.
Btw, programmers that work for other company's do have the time pressure, deadline's, when we calculated 150 houres to program code, then I will not write in LAD just because the electriciens should be able to figure it a little out.

I'm a bad programmer :unsure:
Of course it should not go into exaggeration, thats not what I meant.

Maby you think I am ridiculous when I say "bad programmer", but thats what I think, to exaggerate a little. It is very annoying sometimes when you search for faults in just simple logic where the programmer has written it in a way where you only can see it in STL. Then it often takes longer to find the fault (and that costs money).

Too bad you decide the language, and not the customer... But in a way I guess they are, since they want the cheapest possible!
 
I am going through the same issues. Our machine was built in Italy and programmed with S7 in stl, everyone here knows Ladder and this cannot be translated to ladder, do you know of any 3rd party software to translate the S7 stl to ladder as Greysoft did in the early 90's?
 
PontEL said:
Too bad you decide the language, and not the customer...

We have customers (usually big 3 automotive) that actually do have specifications on what language can be used, how the memory is to be organized, etc. so their electricians that "take possession" of the equipment have less of a learning curve maintaining it. In the overall picture, it actually makes good sense.
 
cwininger said:
I am going through the same issues. Our machine was built in Italy and programmed with S7 in stl, everyone here knows Ladder and this cannot be translated to ladder, do you know of any 3rd party software to translate the S7 stl to ladder as Greysoft did in the early 90's?

It's usually possible to reorganise an STL programm so that most of it can be viewed in Ladder or Function Block. As a rule it's usually a case of first breaking the individual sections of the program into separate networks and then adding NOP and BLD instructions as required. By going the reverse route of writing small programs or parts of a program in Ladder and then viewing them in STL you can fairly quickly learn what's necessary to rebuild the STL code so it can be viewed in Ladder. Of course, there may be some bits of code where the commands only exist in STL and these cannot be converted, but usually this will be less than 10%, or so, of the code.
 
I work mostly in STL or in FBD.

As RMA stated, if you take care of how you arrange your code, it can almost always be converted to LAD.

When learning S7, I focussed on learning STL while learning all the ins and outs of Step7. I found it to be worth the effort.
Come to think about it, I usually switch to STL when I open a block thats written in LAD..........hmmmmmm.....

As for which is better. That depends on who is going to use/read/troubleshoot it later on. Depends on what he likes or find the easiest.
For me it would be STL, hands down. Faster, compacter and much much more possibilities.
 
I'm a little biased towards Ladder since Ive been using it for over 35 years. A maintenance person has to know plc’s to be a good troubleshooter in the world of automation. Ladder Logix, if layed out properly there is nothing better for the person having to troubleshoot a machine , easy to see whats going on. Most of my experience has been with Allen Bradley and some seimens, ST has its place, to much in the wrong place can be a nightmare to troubleshoot. Function block can cause unforeseen problems also if no used correctly . Ive seen engineers that can't follow there own programs. The trouble that I see time after time is some engineers seem to think there code will work and no need to change it, In a perfect world where machine are setup perfectly all the time and parts don’t wear. I have never seen a program that didn’t have some bugs, and sometimes those bugs don’t show up for months even years. Ladder is easy to modify if it has been written properly. If a machine breaks down in the middle of the night in a 24/7 operation, is the company going to call in a software engineer to troubleshoot it , I really don’t think so. It may be easier to write or save time writing it , but if it extends machine breakdown time , there can be a high cost to the end user.
I’ve seen it said somewhere on this forum that anybody can do ladder logic , maybe somewhat true, doing it well is another story. There is enough info online that anyone with half a brain could write code , that goes for any code. Structured text maybe the advanced language but do you need a 5 lb hammer to drive in finish nail . Write programs with the end user in mind.
your machine can a piece of junk if those responsible for maintaining it and trouble shooting it cannot understand what the plc code is supposed to do and how to troubleshoot it.


I firmly believe in the KISS method – keep it simple stupid


The shiny new tool is not always better


Jazzman
 
This is one of those "it depends" question.

PLC programming isn't done for the convenience of the programmer. It is done to make a machine or process operate reliably. That includes debugging and maintenance. Elegant code doesn't mean diddly.

I'm in agreement with jstolaruk. If the staff are more comfortable with ladder, which is often the case, then go with ladder. Frankly, I prefer programming in ladder for the same reasons. I have programmed in function blocks and several high level languages and ladder. I found that in ladder I could spend more time making the process work and less time figuring out the programming.

Go with the language that gives the most total value to the owners.
 

Similar Topics

Hi people, what would be the cheapest way to program a PLC which will be used in manufacturing and why? 🍻
Replies
10
Views
2,877
Hi, I have to start-up a project from someone else. He makes steps like this: "DB aanvoer1".toestemming is needed for start-up in...
Replies
10
Views
5,637
Dear all, I have fx2n plc on my hand but I don't have the programming cable sc-09 and it would not be easy for me to get one. I need the cable...
Replies
3
Views
117
Hi all, i am the new controls guy at the plant and i have inherited a pc from the previous controls guy with Siemens tia portal version 16 and 17...
Replies
20
Views
903
I need to pull the program off of an old 90-30 so I can convert it to Allen Bradley. This is my first time messing with GE and I don't have the...
Replies
2
Views
87
Back
Top Bottom