PLCskilltree

๐Ÿ”ท PROGRAM STRUCTURE > Programming Language ๐Ÿ”ท

I've been meaning to write something about this topic for a long time. Especially now where there's a lot of talk out there on programming languages, what AI can do for your logic in the future ๐Ÿค–, how high-level programming languages like C++ and others could fit into the mix etc...

There's definitely been some entertaining content ๐Ÿ’ฌout there from both the old-school PLC folks and the new up-and-coming ๐Ÿ˜€.

Although I enjoy reading most of those posts (I'm always ready to learn new things ๐Ÿง‘โ€๐ŸŽ“), I think they often overlook one important point.

You see, a real-life application ๐Ÿญ e.g. a production line, a processing plant or a stand-alone machine - isn't just inputs, outputs, global and local data, and a bunch of logic ๐Ÿงฉ to connect them all together (in other words: the programming LANGUAGE).

If you zoom out ๐Ÿ” and look at the bigger picture ๐Ÿ–ผ๏ธ, a real-life system is really a collection of modules - smaller, logical, self-contained units ๐Ÿ“ฆ (you got it - the program STRUCTURE).


And if you did your homework right, those modules should be:
โœ… Scalable
โœ… Easy to troubleshoot
โœ… Simple to maintain
โœ… Straightforward to update



In my opinion, this is what separates the 1% of PLC programmers from the rest - the ability to create modular PLC software - not just being great at ladder, structured text or any other language out there.

I feel there is way too much focus on programming languages and nowhere near enough on how to structure an application properly. You could write flawless code in the โ€œperfectโ€ language, but if your structure sucks, no-one will have a nice time troubleshooting your PLC application๐Ÿ”ง (speaking of which - I'm in the middle of one such mess right now ๐Ÿ˜…).


So what should you actually do before diving into any programming language?
๐Ÿ‘‰ Break your application into smaller, manageable parts
๐Ÿ‘‰ Define the key sections of your application (general, equipment, safety, motion, library, global data, etc.)
๐Ÿ‘‰ Create clean, independent data structures for each module
๐Ÿ‘‰ Build reusable functions or function blocks for repeatable logic (or at least define them - the logic comes later)


And the best part? ๐Ÿ’กThese structuring principles apply regardless of the programming language you use. Your program structure is like LEGO bricks ๐Ÿงฑ - itโ€™s the framework you define to build your application. The programming language? Thatโ€™s what goes inside those bricks.


So next time you start a new PLC project, remember:
1๏ธโƒฃ structure first
2๏ธโƒฃ language second


I appreciate you making it to the end of this little rant of mine ๐Ÿ˜


Do you agree with me, or have some other opinions?
โฌ‡๏ธ Let me know in the comments below โฌ‡๏ธ


Stay structured!
-Hans

PS. If you want get structured in TIA Portal, then grab my free guide right here ๐Ÿ‘‰www.plcskilltree.com/free-guide-optin

Youโ€™ll learn 5 simple steps to drastically improve the structure of your PLC applications in TIA Portal ๐Ÿ’ช

2 months ago (edited) | [YT] | 9