ControlLogix: Ladder vs. Structured Text

Really ? Is that why it has become one of the most popular, if not the most popular PLC language since the 1960's.

As a visual representation of the running program, it suits the widest audience, from seasoned programmers to low-skilled maintenance techs....

Keep in mind that he is (I believe) using a Codesys based editor. Codesys does not have a very good ladder editor. Meanwhile, with Rockwell the reverse is true - good ladder editor, bad ST editor.
 
Really ? Is that why it has become one of the most popular, if not the most popular PLC language since the 1960's.

As a visual representation of the running program, it suits the widest audience, from seasoned programmers to low-skilled maintenance techs....

Like i said, it's just my opinion. I feel that ST is very simple because you can just write the code you think. IF this AND this OR that AND this THEN...

By the way, was there any other programming languages at the 60's ?
 
I am not sure about other PLC's but a i am using Beckhoff with TwinCat 3 and i can see active variables in ST. Same thing with with FBD. I can't see any advantages in Ladder. Of course this is just my opinion but i feel that Ladder is very unclear.
A good ladder editor will not only show the status of the online variables, but also the status of the logic result, even in the middle of a ladder rung (* not sure if Twincat does this).
That makes it very easy to follow the logic, especially when the logic changes quickly.
And, you have to admit that it is very intuitive that you can just follow the green status through an entire rung in order to immediately understand why the rung is true or not true.

edit:
The above is to argue that the online view of ladder is more immediately informative than ST or IL.
But even when viewing or editing code offline, Ladder is better than ST or IL for logic (boolean algebra).
This because Ladder is a visual language with no need to perform an interpretation in ones own mind, whereas text-based languages such as Structured Text and Instruction List require that you read, understand and interpret the logic in your mind.
It is good that ST uses immediately understandable mnemonics (IF, THEN, AND, OR etc), but Ladder is still better. ST has a tendency to become verbose for logic code.

The advantage of ST is that you can perform more complex tasks in a compact and efficient manner.
For example, to perform loops in Ladder is possible, but will take many rungs, which may be less readable and less easy to maintain than loops in ST.
 
Last edited:
In ladder if it is in a straight line it is an "and statement" if it branches down it is an "or statement"

Do it in ladder. Structured text is not as flexible, easy to read, or as simple as ladder. Do it right or don't do it at all.

I've programmed in RISK assembly languages, java, python, C++, ladder and flow... You can see the green bars light up on contacts in ladder. Don't do it in C.
 
Last edited:
i should say that in my experience "jumping" the regular program scan order is considered in the plc world just as bad practice as using go to statement used to be considered in basic, visual basic etc. Each has its use but better to be avoided for clarity.

Modern plc processors are typically fast enough so not to worry about the execution times and not to skip sections of the code with jumps. Just my two cents.

+1
 
+ Regarding ST: depends on what you're used to, to ordinary computer programmers most written programming languages are easy to read, as you start to readily recognize indented blocks as significant (loop, if, etc). The crappy Renu HMC's I've been using lately show the current values in the ST when online in an intuitive way; showing online tag state is not exclusive to LD.
+ Regarding Mara's point about languages in the 60's, guessing the options were ladder logic or something resembling assembly. The PC didn't really come along until the late 70's, so before that programming was done with handheld programmers (highly doubt the ladder logic was nice looking, or even graphical, or had the ability to go online), and the workstations of the time. Keep in mind, talking about actual PLCs of the time, not computers used in a control capacity.
 
so before that programming was done with handheld programmers (highly doubt the ladder logic was nice looking, or even graphical, or had the ability to go online), and the workstations of the time. Keep in mind, talking about actual PLCs of the time, not computers used in a control capacity.

Yup, this was how the SLC150's were programmed when I started in this crazy field:
s-l1600.jpg
 
Do it in ladder. Structured text is not as flexible, easy to read, or as simple as ladder. Do it right or don't do it at all.

The "Right Way" is not the same for all applications. I once had to parse an ASCII string coming from a gauge in ladder logic in an SLC500 so that I could pull the measurement numbers from the string.

It took a couple days to figure out and probably 15-20 rungs after optimization. 3-4 lines of ST (which didn't exist for me at the time and never did on the SLC500) would have been much faster, easier to understand and readable for that application.

While everyone has their favorite flavor of programming, what I like about the current direction of PLC programming is that you CAN pick a language that makes sense for the application. And, you can use them in the same program. My programs are almost always a combination of routines in Ladder and ST.
 
By the way, was there any other programming languages at the 60's ?

I learned PLC's with an OMRON PLC and no software or computer... just a portable console. And there was no way of inputting ladder into it. You'd basically write down your ladder and convert it into the language that would describe the ladder (very similar to Assembly in fact).

After a while, me and others wouldn't even think in ladder, but went straight away to that language to save time.

This being said, ladder and to a certain extent FBD are the best when it comes to digital logic as there is zero mental effort in understanding why an output is on or off.

One company I worked for had a few locations and one would program everything in STL (Siemens) and the other had everything in FBD for Siemens also... and the stupidest arguments arose between people from both these offices about which language was the best.

For some reason, they would not agree that it's painful to troubleshoot a long sequence of And's and Or's in STL and the other would not agree on how silly it was to perform complex calculations in FBD and how much scrolling there would be to visualize the entire code.
 

Similar Topics

Is it possible to export a routine programmed in structured text and import it into a ladder routine?
Replies
2
Views
2,879
I created a new program task under that I created 2 ladder files. My first ladder does not have the 1 flag in the ladder icon designating it is...
Replies
8
Views
4,210
Hi all, Is there a equivalent function block that do the same as MOV function in ladder? Thanks.
Replies
5
Views
2,326
I am making some changes in a control logix PLC program that an engineering programmed for my company. In the program they have used the same I/O...
Replies
15
Views
7,408
Hi everybody, Until now I worked only with ladder logic. Now I have a program with function blocks. It looks more complicate, e.g. you have to...
Replies
4
Views
3,055
Back
Top Bottom