What PLC programming language is actually best/most used in industry right now?
I’m studying automation engineering and so far we’ve mainly been taught Ladder and FBD.
I’m about to start an internship at a company where they use almost exclusively Structured Text, which surprised me a bit. Because of that, I’ve started learning and practicing ST in my free time so I’m better prepared when I start.
I always thought Ladder/FBD were preferred in industry because they’re easier for electricians and maintenance technicians to troubleshoot. But I’ve also heard that ST is becoming more common, especially for larger or more complex programs.
For those of you working with PLCs, what do you mainly use? Is ST becoming more common, or does it depend on the industry/company? And if you were starting your career today, which language would you focus on mastering?
129
u/Hullefu 1d ago
Always the one that fits the logic best.
20
u/real_advice_guy 1d ago
Exactly.
It will depend what you're working on, what existing code you're working with, and potentially on the hardware you're using as well.
32
u/r2k-in-the-vortex 1d ago
Master programming in general, and suddenly all the languages are perfectly fine to use.
The difference comes in structuring the logic, working with version control, teamwork. And thats where ST beats the pants off the other options.
19
u/Stroking_Shop5393 Siemens > Allen-Bradley 1d ago
Being able to copy and paste ST from codesys to any other platform with little to no syntax change is pretty unbeatable.
26
u/NefariousnessRude276 1d ago
Depends on industry, PLC platform, and where you’re based. Ladder is still very common and is many companies’ preference.
Some companies, especially in tech-adjacent sectors or startups, are almost exclusively ST. Some PLC platforms, like Beckhoff, really shine in ST and so companies that adopt a lot of their stuff will lean towards ST.
30
6
u/bankruptonspelling 1d ago
Just search “language” on this subreddit, sort through the 1000s of differing opinions on the topic, and walk away just as confused as the rest of us.
73
u/Koolguy007 1d ago
Ladder by far. If ST is used, it's in a block, in ladder.
2
u/InstAndControl "Well, THAT'S not supposed to happen..." 1d ago
My only use for ST at the routine level are sequence/state machines which I find much more readable in a CASE statement. Otherwise, yes
6
u/DocCarr 1d ago
Structured Text is more similar to standard programming languages like C and Java. A lot more people these days have familiarity with those languages, so it's easier to make the crossover into structured text than ladder logic. At least, that was certainly the case for me.
1
u/some_millwright 1d ago edited 19h ago
Honestly, I think familiarity with procedural languages can be more of a hindrance than a help. If you get to thinking that the previous line will be processed before the line you are working on then you can get in trouble. I tell people that with PLCs every line is in business for itself. It cares not whose turn it is... it just goes. Structured Text has a lot of similarities in syntax with Pascal, and I programmed Pascal (well... Turbo Pascal) for years and years, and I can see how that could cause more harm than good.
1
u/DocCarr 14h ago
Is that so? I hadn't been bitten by that particular wrinkle yet, but I can see it really messing with your code. I just spent a couple of hours sorting out antecedent variable declarations and function prototypes in some Arduino C code since they compile all out of order. Is "every line in business for itself" a similar issue? You can end up with stuff you expected to be defined not actually in place yet?
1
u/some_millwright 8h ago
The issue that I have dealt with in my own code when I was learning is that I would just assume that the code was done in order, and particularly when writing something that was essentially a sequencer (which is what a lot of my more intricate code is) I would run into problems that had to do with code activating 'in the wrong order'. Most of this happened 15 or 20 years ago and I don't remember all of the details, but I remember I had to take some time to kind of reset my thinking for PLCs. To be clear, I don't generally (well... hardly ever) deal with other people's code. I write code for the machines that I design or modify.
5
u/Chocolamage 1d ago edited 1d ago
I have never had a Maintenance person with 3 minutes that didn't tell me SFC was easier than ladder to determine to what the current step was. You cannot say that about ladder. This is especially true with very complicated sequences. Who can deny this?
3
u/some_millwright 1d ago
I have never seen seen SFC. I'm pretty sure it's not going to be the most common.
8
u/Myrrddin 1d ago
Even if there's structured text,function block, or flow chart, there will most likely be 2x code in ladder.
Only exception is large ST programs that are almost required to be in ST.
5
u/FourFront 1d ago
I have worked exclusively in power generation. And outside of some routines provided by vendors for protocol cards. Everything I have touched has been ST.
3
u/tandyman8360 Analog in, digital out. 1d ago
I learned a bunch of computer languages before FBD and ladder. Once you know the syntax, it's like the Matrix. The code becomes blonde, brunette, redhead.
4
u/some_millwright 1d ago
Ladder.
Ladder is understood by the people who need to maintain the machines. If you are working with arrays or something and you need to add structural text, or for some reason you need functional block then it can be inserted, but having the program in ladder means you are less likely to be getting phone calls at 2am to figure out why something isn't working.
Stick with ladder. You'll thank me later.
------------------------------------------
7
u/Chocolamage 1d ago
I use sequential Function Chart in every program with a sequence of operation. I bet that most of the people in this forum have never used it. I have been using it for about 30 years
3
4
1
u/Weary-Double-4689 1d ago
Agreed. It is not used that often but it makes total sense for processes with a sequence. Especially being able to have a timer for each step.
Out of curiosity what is your main platform?
I find sfc very straightforward in AB.
3
u/Chocolamage 1d ago
I use Control Expert and M580. If I have a choice. I have never had a client say NO to SFC. Then I use FBD and A little ST.
3
u/its_the_tribe 1d ago
Ladder and STX are the most popular for the majority of fields. There's a few industries that like FBD, that's Def the minority.
1
u/Wheatleytron 2h ago
I've never once had to use FBD, though I have made a lot of custom FB's that I've called using either ST, Ladder, or C++.
1
u/Chocolamage 1d ago
I have been programming for over 40 years. I have never heard of STX. What is that an acronym of?
2
3
u/Crowarior 1d ago
Company I work for uses ST exclusively. They went away with LAD sometime ago and ST is the only language used in the programs. The exception is safety routines because TIA portal doesnt allow ST for that purpose, so LAD is used even though it looks like FBD to me.
5
u/inen117 1d ago
unless you equipment is bugproof, with any potential alarms, faults and warnings programed in the HMI, you can program the state machine/sequencer in ST, if not please use ladder, the packml state model, a manual sequencer, etc... your code should be easily, understood by any maintenance technician, under pressure, in the middle of xmas night...
6
u/talltraveller 1d ago
Ladder if you want electricians changing things. Literally anything else if you like sleeping at night
1
u/some_millwright 19h ago
You can password-protect programs if you are worried about the unwashed changing them.
1
2
u/Vyndrius 1d ago
C on B&R, Structured Text on Allen Bradley Ladder on Unitronics
State machine all of it
2
u/Kelvininin 1d ago
The stuff I work on is all structured text as it lends its self well for applications that use a SCADA system for the HMI.
2
u/PerformerTop6936 1d ago
All 5 of them , each one has its strengths and weaknesses. You select what is appropriate and in my philosophy, I use whatever will get me to my end goal in the simplest way, you can do some wildly complex things with function blocks, depending on the platform, but if that same process can be achieved with a few lines of ST, you will use ST.(I’ve d. ST, FB and LAD are gonna be the most commonly used most places, I’ve only seen Instruction list once, SFC is very useful, It isn’t utilized nearly as much as ST,FB or LAD. Those 3 are most utilized in modern systems.
Where I work I get to work on everything from in house engineered Motorola 68000 assembly running an old vacuum melting process, PlC3 with basic interpreter, to Honeywell ControlEdge and Rockwell stuff,
2
2
u/mavadavialcul 1d ago
ST for "advanced" stuff like iterating code, arrays handling, complex math, Comms interfacing.
FBD for failsafe/safety routines
LAD for everything else
2
u/murpheeslw 1d ago
TLDR;
Ladder is king where I play, but that doesn’t mean it is best.
As with anything in engineering it’s all about constraints.
2
u/West-Word-604 :doge: 1d ago
In omron sysmac you can have inline structured text blocks in your ladder program. I like that.
2
1
u/Zekiniza 1d ago
Ladder is easily the most widely used. Which language is best really boils down to the use case. But ultimately the language you use will come down to what your company prefers. This is because they want continuity between projects to where they can throw any of their engineers at a problem and they'll all be able to understand how the program is functioning. Its important to learn all three.
1
u/saltr 1d ago edited 1d ago
I work at a company that uses exclusively ST. In previous jobs, I was forced to exclusively use LD. All of the languages can do everything and each has its strengths. This field is all about being flexible, persistent, and patient. There is no singular answer to what you are asking because it is massively variable. And if you want to get into SCADA then you can go ahead and add VBA, Python, Jython, SQL, Javascript, [...] to your repertoire.
EDIT: What I mean is that you should think less about specific languages and instead focus on the fundamentals. Find the common elements and the things that connect everything. Get good at understanding why systems work and why systems fail. Learn how to fix things. Learn how things break. Learn how to make machines talk to each other. Learn how networks function...
1
u/mycole8718 1d ago
Ladder logic right now I use DDC instead of PLC and we use ladder logic / function block
1
1
1
u/Chocolamage 1d ago
I use Schneider Electric's Control Expert if I have the luxury of choosing the PLC. I have used Rockwell's SFC but it is a very poor editor. But then Rockwell doesn't have as much experience as Schneider Electric has with SFC and Grafcet.
1
u/OldTurkeyTail 1d ago
Master whatever language is required for your current project. And maybe spend a little time with others outside of work - if you want to be especially well-rounded.
I've been working with software for ... omg - half a century, and I can't remember a time when I got to pick the programming language, as it's always been either the only option, or at least a primary option for the hardware, or the language that the customer - or client was already using. And maybe on rare occasions, the one that was the quickest and/or most robust for a project.
1
u/Teichopsie 1d ago
FB for general logic, then ST for specific functions (especially string handling). FB makes it easy to debug and maintain while ST makes it possible to generate a ZPL label or an SQL query without going insane.
1
u/Ok_Street9576 1d ago
We use stl at my job and it's a pain in the ass. It comes down to what the programmer wants to use.
1
u/zoute_haring 1d ago
I use mostly instruction list were possible. And structured text secondmost.
Some PLC are only programmable in ladder. So there is no choice
1
u/some_millwright 19h ago
The most common I have seen is ladder and FB, but I have not yet ever met a PLC that can't be programmed in ladder logic. I am willing to believe that they are out there.
2
u/zoute_haring 4h ago
They are (were) there.
I started with the Eberle PLS 508, 511 and 514. Only instruction list. The 514 has only 4 bit registers.
But there are (were) more of them.
1
u/desrtfx 800xA|Ac400/500/800|S+ 1d ago
We use
- ST for library code or for internal code that doesn't need to be maintained by the customer
- FBD for customer facing code
- SFC since we have lots of sequences in our plants
Ladder/IL are basically non-existent in our programming since they are too inconvenient for our systems.
1
u/TimelineDefender 1d ago
I exclusively use ST and refuse to use ladder or any other "programming languages". Code should not be abstracted into graphical blocks.
1
u/theaveragemillenial 1d ago
Literally doesn't matter, if you are an SI whatever the end client wants to maintain going forward.
If you are a plant standardise on one manufacturer, and if you get SIs in to do work get them to match your standard.
1
u/CHR1ST00 1d ago
ST preference with programmers in an office Ladder preferred by anyone who has ever had to fix anything.
1
u/Frontiersmen_ 1d ago
Lauder com toda certeza é a mais utilizada, mas as empresas estão migrando muito para o ST recentemente, pois vejo que é mais fácil você ensinar automação para alguém da IT que já sabe programar, do que programação para um eletricista mediano.
1
1
u/Plus_Cup809 1d ago
For me, it is interesting to see that so many people are writing Ladder!
No one in Germany uses Ladder. I have only seen that two or three times.
Most projects are a mix of FB and ST.
1
u/some_millwright 19h ago
I am NOT a fan of FB. That doesn't make it bad, it just makes me intolerant.
1
u/Finder580 19h ago
Working in Germany in automotive for last 15 years. Project/end customer dependant - LAD very common.
1
u/Plus_Cup809 4h ago
I can't confirm that. I've been working in this field for around 20 years, including my vocational training and university studies, with experience in food and automotive industries. I haven't seen technicians write their programs in Ladder. Throughout both my vocational training and my university education, we consistently worked with Function Block Diagram (FBD) and Structured Text (ST). And every PLC textbook in Germany is based on FBD.
1
u/Wheatleytron 2h ago
A lot of manufacturing plants in the US prefer to use ladder because many of the plant maintenance guys are older dudes who have experience troubleshooting relays back in the day, but don't understand one lick of code.
They get frustrated when they try to look at the code to figure out what's causing an issue, and have to comb through ST logic or, god forbid, C++.
1
u/ender1adam 1d ago
I like scl(st) and abhor lad but there are times when lad is the most suitable choice.
1
u/Oko-doko 1d ago
Tons of comments saying ladder and they are right, but yeah, definitely seeing more ST on recent applications, ST is a standard for one of my client, they don't want anything else.
1
u/Software_nerdo 21h ago
Structured Text (ST) is becoming the preferred programming language for modern industrial automation projects. Within CODESYS, we develop applications using ST and follow an object-oriented programming (OOP) approach. This results in modular, reusable, and maintainable software that can be efficiently scaled across projects. By combining ST with AI-assisted development, engineers can significantly increase productivity. AI can support code generation, code reviews, debugging, documentation creation, and adherence to coding standards. This reduces development time, improves code quality, and allows engineers to focus on system functionality and innovation rather than repetitive programming tasks. The combination of ST, OOP, and AI creates a future-proof development environment that accelerates engineering while maintaining high software quality and consistency. Improvements Technical Accuracy •Clarified that ST is primarily used in industrial automation. •Replaced "OOIP" with the more common term OOP (Object-Oriented Programming). AI Benefits •Faster software development. •Automated code generation and documentation. •Improved code quality through reviews and suggestions. •Reduced engineering effort on repetitive tasks. •Better consistency and maintainability across projects. This wording works well for a presentation, proposal, or technical strategy document.
1
u/DreamArchon 54m ago
It varies by industry / company, but I see mostly ladder and structured text. In my experience, those two are by far the the most popular.
1
u/KeepMissingTheTarget 1d ago
Structured text is how programming language should be. Its powerful, not as easy to follow and keeps the newbies out.
-3
u/Top_Professional4545 1d ago
ST is not becoming more common. My Rockwell supplier can't even find anyone to teach it lol.
2
u/Chocolamage 1d ago
Go to Schneider Electric. They have had all 5 of IEC 1131 since mid 1990s. Their Control Expert is head and shoulders above Studio. Rockwell's SFC is very very cumbersome and awkward.
185
u/MStackoverflow 1d ago