My question is pretty simple. Is there any useful place for learning to work with Siemens PLCs?
-
Here there are some beginner course: https://www.youtube.com/results?search_query=siemens+plc+course – Nifriz Jan 09 '19 at 16:05
-
1`"learning to work with Siemens PLCs`" is crazy broad. Do you mean you want to learn best practices when programming in Ladder Logic? – Narm Jan 09 '19 at 16:06
-
@Narm Yes!! Every PLC proffesional would know what to write here. I worked with Festo PLCs, but that was a faculty course/exam. Thanks in advance. – Ferid Š. Sejdović Jan 09 '19 at 16:07
4 Answers
Full Disclosure:
- I was a Software Engineer for Rockwell Automation working with their A|B PLCs
- You probably won't like my answer
To put it plainly programming PLCs whether you're using Ladder Logic, Structure Text, Instruction List, Sequential Flow Chart, FBD, or Continuous Flow Chart isn't the same as programming software in a language like C++, Java, JavaScript, etc...
Simply put, there is not one set of "best practices" that fits every use case. The reason for that is, because unlike your standard software development which you can apply principles like the SOLID principles to always make your code easier to read, maintain, and extend. PLC programs are associated with a very real physical process and physical machinery. Often times what you find in the industry is that every plant/manufacturer/facility establishes their own set of best practices given their facilities needs and process.
To give an example:
Scenario 1: The logic used to run the distillation process for a small local brewery may include sub-routines or even a loop. They may allow 5 or less warnings in their code, and allow a few unused tags. That is totally fine, because they are making beer, the process isn't critical, a bad batch won't kill anyone, and they only have 2 pumps that their using the logic to iterate over. So if there is a problem that needs trouble shooting the logic in the sub-routines or loop won't be too much of a headache.
Scenario 2: I am a global pharmaceutical company producing 100's of millions of life critical drugs each year (say insulin). Now my logic is has zero sub-routines, no looping, I have zero tolerance for errors or warnings, and absolutely no unused tags. Why, because I am a highly regulated industry and if their is an issue with one of my products, people may die. Also why no sub-routines or looping, because I am a huge company with hundreds of pumps, mixers, etc... When one of those pieces of equipment go down I don't want to look at some horrible looping logic that is responsible for the logic of hundreds of pumps. I want to look at one select piece of the logic that I can quickly understand, correct, and get my line back up and operating.
I am sure you can find some articles or courses out there (like the one you already took) that explains some basic "best practices", but in the real world you will need to adapt your logic to every individual scenario in order to achieve the best outcome. That is my humble two cents on the matter, best of luck to you!

- 10,677
- 5
- 41
- 54
-
-
Personally it offends my pride to produce any PLC code with warnings in it :D But I think you may be throwing out the baby with the bathwater. There are definitely standard principles that can be applied (albeit with a PLC twist). Unless your insulin code is written in one big block, you have already broken your code into blocks that resembles the S part of SOLID (and that is without looping or subroutines). (If not you have a maintenance nightmare). You should also be using a form of POLA so that the operation of your machines are consistent across your code base. Etc etc – Peter M Jan 29 '19 at 17:19
-
Is there any specific reason, why Subroutines such as Function or Function Blocks are not used? – nandgate Jul 09 '19 at 04:01
- Udemy - there are some courses there, though I haven't tried them myself.
- I've watched lots of useful videos on YouTube.
- http://www.plcdev.com/siemens_simatic_step_7_programmers_handbook - quite old, but could be usefull.
- Siemens forums, official manuals, guides. There is lots of info there, quality varies sometimes, but mostly good.
BTW, a nice thing about Siemens is that you can often look up things just by searching the web. That is not the case for some other PLCs...
Good luck!

- 11
- 3
If you work already in a factory. Read the code that's run in PLC-s. And start modifying it, if needed. Thats how i started, I was initially lowly automation guy. Pulled cables, changed broken sensors etc.
If you don't, and you need a break to the field, then as ordinary tech worker, the path is usually from electrician or automation engineer. Or as entreprenuer/independent contractor, i have seen people just do it. Like win a contract for some public company request, do some schematics, write code, do electrical montage all by themselves. Or just do parts of it with other contractors. You need previous experience to pull it off
As for some practices:
- If you are modifying existing code. Always use existing style, existing functions and blocks.
- Do not use programming patterns from ordinary IT world in low PLC code. Or use with caution. Reason for this is that your code probably has to live for years and years, and has to be debuggable. Patterns usually add layers of complexity, complexity leads to harder debugging. In automation world it's usually better to debug stuff thats closer to hardware.
- If you are starting to make project where you have tens or hundreds of sensors/motors/actuators, start using reusable blocks.
- All best practices are learned in the field, sadly theres no other way. I know it's kind of catch22 sometimes. Need work to get experience, need experience to get work. I entered automation world, and later IT world the same way: get a job and the low end, maintanence guy or junior IT developer, gather experience, in a year or two you will be in mid-level.

- 180
- 1
- 9
And don't lose any of those constraints while your programming PLC :
- PLC programming is very low level programming
- memory size matters, each byte must be important
- logical have to be concise and as short as possible : sometimes you have to be good in math !
- the machine you're working on is dangerous and can provoque product, equipment or human damages
- the machine you're working on is expensive and is built to produce for years
It's the same as in computer programming : each programmer has its own way to program, there's no truth. Sometime you'll find some interesting existing code : don't hesitate to re-use it if it looks smarter and is more efficient.
Find your way and keep in mind the machine you're working on is dangerous for you and the people walking around (it's not always the case but it's important to keep this in mind while programming).
And moreover: don't forget the first rule in industrial automation : if it runs correctly, don't touch it !

- 708
- 6
- 9