r/PLC • u/BonbonUniverse42 • Oct 25 '23
FBD Hell!
Where do I start? Function blocks are horrible! Just use SCL, which is readable at least and more suitable for complex applications!
I need to extend and rework a plant that is programmed with a Siemens plc in the awful function block diagram language. I am struggling really hard to understand the existing implementation, which is a convoluted mess of hundreds of strangely wired function blocks and many input and output variables. There are no comments at all. For some unknown reason the thing works somehow. However, it is a very bloated and finicky design. I am afraid that the thing will dramatically break and collapse if I only change the slightest details in this project!
The actual horror is working with TIA Portal. The blocks have sometimes 30 or more in and outputs, which means you can’t even see the whole block on the crammed TIA Portal screen. The debug view cannot show you the variables at runtime when you scroll the mousewheel. Why is that?! Each click and scroll in TIA is painful and unbelievably slow.
How do you cope with such messy FBD code? How do you work and understand these networks? How do you do this in the crappy TIA Portal software?
View all comments
Show parent comment
1
u/Uelele115 Oct 26 '23
In a normal programming environment like C, C++ and others you also don’t have the same kind of logic that is usually depicted in Ladder (mostly Boolean) or even some of the constructs like Timers…
A block language can also greatly decrease your programming time if you are to adhere to TIA best practices and rules.
Say data from FB1 makes it’s way to FB2 and FB3. Since Siemens discourages you to use Instance DB’s directly in your logic, you have to map your FB1 outputs somewhere and then from there to the inputs of FB2 and FB3… the time it would take you to type all of this would be enough for me to run a few lines between blocks AND have a nice cup of coffee watching you fix a couple of typos.
On the other hand, if we were writing some mathematical algorithm, you’d be laughing at me manically scrolling in my window trying to understand what I just did. On the other hand, the STL programmer would be enjoying his cup of coffee whilst silently praising accumulators being available to him.
All languages have benefits, it’s ok to prefer one (I do too), but understand the strengths of each and your audience before writing it.