Click the blue text for more exciting information
PLC Ladder Diagram Insights – Advice for Electrical Beginners
To be honest, half of the people programming PLCs in factories today can only copy code from the manual. There are very few who truly understand how to write good ladder diagrams. I’ve been in this industry for almost 20 years, starting with Siemens S7-300 in 2005, and now working on PLC integration solutions, I’ve seen too many failures.
A few days ago, I visited a paper mill in Zhejiang where the owner spent a lot of money hiring a so-called “automation expert,” but the program he wrote crashed after running for half an hour. When I looked at the ladder diagram, I almost laughed out loud — he crammed all the logic into one network, looking like a plate of noodles; who the hell can maintain that?
The first rule of ladder diagram programming: one network should only do one thing. Whether you are using old Siemens or AB PLCs, ladder diagrams must be organized. Recently, I helped solve a problem in an automotive line, and when I looked, one network had hundreds of contacts. I said, brother, are you in a war? The program froze as soon as it heated up, and the reason was that simple.
Many people think ladder diagrams are outdated and insist on using ST language to show off. That’s nonsense! What can the electricians on the factory floor understand? Showing them ST code that looks like C language is worse than giving them a book in a foreign language. Ladder diagrams are intuitive, easy to modify, and maintain, which is exactly what is needed in an industrial setting. Of course, using ST for some complex algorithms makes sense, but the core logic is still more practical in ladder diagrams.
Speaking of touch screen human-machine interfaces, I don’t know what the younger generation is thinking, insisting on piling up a bunch of flashy animations. Instead of that, why not just make the buttons bigger? Last year, I went to a chemical plant in Ningbo, and the operator, wearing gloves, couldn’t even press the buttons accurately. Why make them so small? Remember, designing HMI should be simple and direct; the operator should be able to understand it at a glance without unnecessary clutter.
I won’t say much about the debate between Siemens and AB; it’s like religion, each has its loyal fans. But I must say, Siemens’ FB parameter passing method is much more reasonable than AB’s AOI. In 2019, I worked on a project at an auto parts factory in Guangdong using AB ControlLogix, and the logic block encapsulated in AOI crashed completely if one parameter was misplaced. If it were Siemens’ DB block, it wouldn’t crash so easily.
By the way, when it comes to communication, Profinet is still the best. Once, I went to a factory in Suzhou to troubleshoot; they were using MODBUS TCP, and there was severe packet loss. Upon investigation, I found they were using a regular office switch. I said, brother, can you use such a switch in an industrial setting? How do you handle interference? Industrial communication must use industrial-grade equipment; saving money here is digging your own grave.
Below is a ladder diagram template I usually use; this writing style has saved me countless times:
// Main control process segment - simple and clear
|--[ ]--| |--( )--|
| Start | | Run |
| |--[/]--|--[/]--|--[ ]--|--[ ]| |
| | Stop | Fault | Condition1| Condition2| |
Here’s a little trick for servo control that many people don’t know:
// Read position before starting - this prevents sudden servo jumps
|--[ ]--|--[ONS]--|--[ ]--|--[ ]--|--[TON]--|--( )--|
| Start | One-shot | Read Position| Position OK| T#2s | Enable |
Speaking of process control, tuning PID parameters is like dating; no matter how much theory you understand, without practical experience, it’s useless. I remember once at a steel mill, the temperature control system kept oscillating, and a recent graduate was calculating with formulas for a long time, but it only got worse. I simply reduced the I value and increased the D value, solving the problem in five minutes. The young man asked me how I knew, and I said that’s called experience, something your formulas can’t teach you.
By the way, regarding temperature control, you must pay attention to the sampling period. Last summer, at a boiler control system in Hebei, their engineer set the temperature sampling period to 100ms. I said, brother, do you think the boiler temperature can jump faster than a rabbit? … The system’s CPU load was very high, all due to unnecessary sampling. For temperature parameters, sampling once per second is sufficient!
The most troublesome part of system integration for me is the communication between devices from different manufacturers. A few months ago, at a pharmaceutical factory in Shanghai, they had Siemens PLCs, AB frequency converters, and Japanese weighing modules, insisting on integrating everything together. I said, isn’t this torture? In the end, we used OPC UA as a middleware, and it finally worked, but the latency was terrifying. The best solution for system integration is to unify brands; saving money is fine, but will the money saved be enough when engineers jump ship?
And then there’s Industry 4.0, the Internet of Things, digital twins… a bunch of new concepts that sound great, but when it comes to implementation, there are all kinds of pitfalls. After the factory leaders returned from a trade show, they insisted on moving to a cloud platform. I asked them what would happen if the cloud platform lost connectivity? They couldn’t even get the local control system right, and they were in a hurry to go to the cloud? Stabilizing the on-site equipment to run reliably is much more important than any flashy concept.
After all this, I want to give a practical piece of advice to electrical beginners: Don’t be afraid of dirt, don’t be afraid of hard work, go to the field more often. I’ve seen too many young engineers who can only draw schematics in the office, but when it comes to wiring on-site, they are dumbfounded. Remember, working with PLCs means climbing to the top of equipment, crawling under the floor, and getting your hands dirty. The theories you learned in school account for at most 20% of this job; the rest is all practical experience.
Alright, I’ve rambled on enough; I hope this is useful to you. Stop thinking about shortcuts, there are no shortcuts in this field; you have to step on many pits. Many people often ask me if there are any secrets to success; I just want to curse — you can’t even understand basic electrical principles, and you want to succeed quickly? Be grounded, young man!
Disagree? Just watch me