Which programming method is better - ladder logic or structured text

sinha_nsit

Member
Join Date
Aug 2007
Location
varanasi
Posts
17
This question is addressed to those who have ample experience with both LL and ST. I know only ladder logic. I find that many a time it takes hours to develop an error-free program for a complex application. Will it be not easier and less time-consuming to write ST program in such cases. In ST, I believe, you can straight away write what you want. It is like plain English. You only need to have experience with some structured language such as Pascal. Please enlighten me on this issue.
 
My customer's electricians are the folks that take ownership and maintain our equipment. They are generally not trained for any programming languages but are easily trained to debug with ladder logic due to its similarity to hard wired relay logic. So, though ladder may not be able to do any of the fancy things a ST style language can do, in the long run the equipment stays up running longer and I get few phone calls (which is my ultimate goal).
 
Structure Text IS Better during development, no doubt

BUT... the ST IDE, integrated development environment, better have some good debugging features. It is very easy to see why a coil isn't energized in ladder. One just looks at the contacts on the rung and sees which is not true. The ST IDE needs to have some way to do the same thing.

What about programming on-line? Most ST programming MUST be done off line but there is no reason why small and simple changes can't be made on-line.

Developing code is much easier in ST. I MUCH prefer a good text editor to crude ladder editors. Ladder editors require too much mickey mousing around. It seem I am always taking my hand off the keyboard to grab the mouse for some reason.

jstolaruk's argument is similar to the S7 programmers debating which is better, LD or STL. Just because many S7 programmers refuse to learn STL doesn't change the fact that STL is more flexible and efficient.
 
I would preferably use both. Depends on the task to be done. Sometimes to use both within the same project. (last project I had to use SFC, LAD, FBD and STL)
 
I'm with Dirt. Each has its place and each can be better suited for the application at hand. I use Grafcet methodology and emulate that with traditional ladder. However, when it comes to handling of arrays, loops and indirect addressing, I'll typically use STX as it only takes a few lines of very readable code, whereas to accomplish the same in ladder ends up convoluted and difficult to follow.
 
Who's ladder logic are you using? Depending on the package, programming with ladder can be brutal. Also, depending on the package, Excel can save you a tonne of repetitive programming in ladder. I prefer ladder simply cause it is easy to debug and visually it is easy to read. ST lends itself to process oriented automation with lots of calculation, low IO counts.

I don't probably need to says this, but programming to re-use code and HMI should always be top of mind.


THIS IS ALL MY OWN OPINION I OWN NO ROCKWELL STOCK :)
 
A combination is the best in my opinion. There are times when structured text and function blocks are time savers. But, for the same reasons as jstolaruk, I try to keep the physical I/O in ladder.

THIS IS ALL MY OPINION TOO BUT I DID OWN STOCK IN ROCKWELL UNTIL LAST NOVEMVER WHEN I SHIFTED MY FUNDS BECAUSE OF THE UNCERTAIN MARKET :)
 
Yes actually TW has it right, a combination is best. The more Function blocks the better.

Main thing is to remember Keep It Simple Stupid, Less is not necessarily better. I can make alot of things go in 1 rung/line but my cow-workers would kill me if they had to go fix/improve/destroy something in my logic.

YOU SOLD STOCK IN ROCKWELL? r u NUTZ?:)
 
RichBlunt said:
YOU SOLD STOCK IN ROCKWELL? r u NUTZ?:)
Not according to my stock report:p
rok.JPG
 
what ever you do, just remember one thing.

your machine can be made of pure gold and cost 1 billion dollars,
but it's absolutely a piece of junk if those responsible for maintaining it and trouble shooting it cannot understand what the
program code is or how to troubleshoot it.

i would ask those guys what they would like to see. by working with them, you are showing them you care and that says a lot.

regards,
james
 
sinha_nsit said:
In ST, I believe, you can straight away write what you want. It is like plain English. You only need to have experience with some structured language such as Pascal

You mean something like this:

Code:
While NoErrorsInMyComplexProcess
DoMyComplexProcess;
EndWhile

Job done :)
 
So, it turns out that, from maintenance point of view, LL is the best, because the maintenance engineers are generally not programming experts. Debugging (I am not saying, 'writing')a ladder does not require much expertise, because a ladder looks similar to hardwired circuit. So, it is easy to pinpoint the problem - a particular sensor/switch not working, external device not responding to PLC output, possibility of wire breakage at a certain location etc.- just by examining the simulation ( or knowing what is expected when) and comparing it with the actual result. And, maintenance gets a very high priority in industry. Something should work and always work with minimum downtime. This is the reason why fancy languages are, in general, not being preferred. They may be good for classroom environment, but not for industrial environment. Any comment from those preferring ST etc., specially from maintenance angle?
 
As a maintenance engineer (but with some programming education ) I would say that structure always is much better than a certain type of language. If you're going to have electricians to use the code for debugging, then use LL anyway. But maintenance engineers which have responsibility for plc, they should know the basics and therefore could handle well structured code. (Unstructed code is worse then learning some basics before debugging)

Just my point of view.
 
Dirt said:
As a maintenance engineer (but with some programming education ) I would say that structure always is much better than a certain type of language. If you're going to have electricians to use the code for debugging, then use LL anyway. But maintenance engineers which have responsibility for plc, they should know the basics and therefore could handle well structured code. (Unstructed code is worse then learning some basics before debugging)

Just my point of view.

Agreed. I have seen some unruly-unstructured-spaghetti ladder logic that was hard to debug even by a seasoned programmer, so well structured code of any flavor is important.
 

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,854
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,620
I'm been deciphering a program for a press here. I've gotten most of it deciphered using the manual to understand the instructions (first mitsu...
Replies
2
Views
22
Hello colleagues, Some time ago I started my adventure with programming. With your help and the courses, things are starting to come together...
Replies
13
Views
594
Dear All, I need a sample PLC program to count the output pulse of a mass flow meter so that a specific amount of mass (for example 100gm)can be...
Replies
2
Views
82
Back
Top Bottom