Disruption in the Automation World, and a practical PLC Code Generator to get started

Wouldn't the used programming language not be an issue if the machine actually reported what is going wrong?

It could be as simple as providing a list of interlocks for a specific function to display which is the one holding things up, or in more complex operations returning an error that can be traced back to a specific step in the program (this is quite common in PC programmers and perhaps is something we could take from them).
If a machine throws error 2003 at you and the manual states that error 2003 means that the proximity sensor XYZ did not see anything in front of it is definitely better than having the program open in front of you to decipher what is going on, isn't it?

Maybe a display of the IO map so you don't have to pick up your meter straight away?

That's the point I'm trying to make, it's fine and dandy when everything is going according to plan. But if you fall outside the plan, its near impossible to troubleshoot.

I've seen sensors, stay stuck on electrically, even thought they showed a changing status, plc inputs go bad in either state, outputs stuck on/off, wires shorting only when you actuated a cylinder to go to a certain position, measuring rods giving signals that were off but not that off, mechanical valves sticking juuust a little bit, harmonic noise, oh and that time that a licensed radio antenna braided shield touched the building structure and affected the closed loop hydraulic system that drives a 1 ton carriage ONLY when the operator was talking on the radio, and I'm sure people can add hundreds if not thousands of really odd phenomenons that cannot be found using standard troubleshooting techniques. A status screen on an HMI will give you nothing, HMI`s are for operators, not the techs, they need ladder.
 
I am getting a whiff of: "like "how can I cut out the cost of a programmer???" , but maybe that's just me.

What you describe sounds like perhaps something that's applicable to a process-batch system, mind you I've never worked on/in one so I don't know ****. I could also see this for an OEM manufacturer of equipment, who wanted every machine to be coded the same.

For those of us that work on smaller scale applications and equipment though, I think its a little hard to implement this. Almost every piece of equipment I work on uses different components and configurations. Constantly trying new things to push improvement and get better results.

Because of that every program is a little different, and the ability to get into the nitty-gritty of the code is important.

Curious what your situation is that you are tired of writing repetitive code? Do you work for a builder, or something where you don't standardize?
 
Siemens PCS7 does this... but the bloat is beyond belief.

Since we've touched on HMI's... Everyone says that Ladder will never go away because that is what the electrician will know how to troubleshoot. However, I can remember 2 systems that even attempted to provide usable diagnostics for a machine/system. Likewise, the manuals for some machines are cryptic at best.

Wouldn't the used programming language not be an issue if the machine actually reported what is going wrong?

It could be as simple as providing a list of interlocks for a specific function to display which is the one holding things up, or in more complex operations returning an error that can be traced back to a specific step in the program (this is quite common in PC programmers and perhaps is something we could take from them).
If a machine throws error 2003 at you and the manual states that error 2003 means that the proximity sensor XYZ did not see anything in front of it is definitely better than having the program open in front of you to decipher what is going on, isn't it?

Maybe a display of the IO map so you don't have to pick up your meter straight away?

Displays of the IO map are actually quite common in HMI's, as are input and output test functions. The problem in that in certain situations you can't force IO. Once again, this is going back to the "subjective" side of the conversation.

Now, I'm not saying that we can't have machines that give us error codes, but to get specific error codes, you will need to add even more sensors, and this creates even more failure points.

Any example of sensor XYZ is not seeing a part. Now this tells us the problem is with sensor XYZ. Is the sensor the right sensor? Is it there? Has it been physically damaged? Is it on dark when it should be on light or vice versa? Is it a 4-20mA proximity sensor that isn't scaled in right?

These are things that, that by looking at the logic we can see what is going on. What about intermittent faults? Intermittent encoder faults where you miss or add pulses. Once again, in order to see things like this we would need additional sensors, or at least PWM and additional circuitry in machines to see, which adds failure points.

At the end of the day, it isn't about control engineers being able to quickly and easily write the code, it is about having a rock-solid machine that can be quickly and easily troubleshot by someone with the least amount of training necessary so that they are cheaper labor finding and repairing the issue.

I seem to be of the opinion that one tool cannot be used to automatically generate code to solve all automation problems, but I sure would love to see how the attempt progresses!

Also, one other thing I would like to include is that our PLC's are designed the way they are so they include only what they need for their function and anything else is in the form of IO cards. This can be done with a computer, but PLC's tend to sit on a lower level of the spectrum hardware AND software wise. This allows us to have as little fluff as necessary in a system, which means less possible points of failure.
 
Here is my opinion on this topic:

Firstly there are a couple of things to consider here. I think mass generating tools are well worth the effort but it depends on the maturity of your standard and the estimation of future roll outs of functions.

I have worked on many projects where we built our own interfaces to generate the bulk code , its great, it allows my engineers to focus on the process interlocking and alarming of the system. I would say that generating the skeleton and repetitive tasks is where you get the value.

I would not do device interlocking or ad hoc alarming at this layer. I would generate the DFBs, DDTs and structure of the PLC program.

Depending on the SCADA i would generate the Tag base, objects ect. Again processes are very specific and i want my engineer to be in the software UI that he is going to debug the system in.

The other aspect for me is managing updated versions of functions back into the code generator UI. Standards develop,evolve and improve over time. I have seen many projects where engineers are spending longer trying to fix the previous versions code generator than getting down to what they actually need to do. This process needs to be simple and intuitive.

The last point i would like to raise is re-usability.This concept would work great in big companies, where there is continuous upgrades of old PLCs and always projects installing new ones. This utility will not work for one of PLC developments, the power really is re-usability. And one has to gauge the value of a tool vs. an engineer sitting and doing the code.

I honestly believe you are on to something here, be wary of not trying to replace the vendor software and do all the programming in this tool. Engineers will always fault find in the PLC vendor UI and i do think this is where they key code (interlocking, alarming , sequencing ect) should be done.
 
One thing I'm missing in this discussion is liability. What or who will be held responsible when an accident happens and the investigators point in the direction of the PLC program in case this program is automatically created?

I think the OP won't like the outcome of that investigation, because in the end it will very likely be the programmer of the generating system...
 
One thing I'm missing in this discussion is liability. What or who will be held responsible when an accident happens and the investigators point in the direction of the PLC program in case this program is automatically created?

I think the OP won't like the outcome of that investigation, because in the end it will very likely be the programmer of the generating system...

I think the core logic that have the variability of the process must be done outside this program. All the program does is generate bulk code. Which should be tested and verified during commissioning.

At the end of the day the program does not test your process and code. That must still be in accordance with commissioning procedures,sign off sheets and functional specs.
 
First of all, I agree with previous posts that open-sourcing is just saying that this code/hardware is not guaranteed to work, so removing the liability, which is not what companies want.

There are both advantages and disadvantages to open source. There is a general trend towards a bigger used of high-quality open source software, including in mission-critical applications.

And very important: open-source doesn't equal free: you either still pay a company supplying it, or you have to invest more in your own teams.

Also, just like Android is Linux based but is not really Linux anymore, open sourcing PLC is not going to propulse the industry in new territories, just create different vendors. And if cost is really the push for open-sourcing, we already have dirt cheap PLC's.

I don't think our first concern is having open-source PLC's. What we need are open PLC's with open interfaces and open drivers.

I use PLC's for machines, I never did batch mixing or process. So those are just my interpretations of the claims. I think this is just a case of bad design of a mixing plant

This kind of design / PLC program structure is the standard in batch-like control. I didn't invent it. See page 4-6 for a list om some companies behind it:
http://www.automatedresults.com/documents/S88-Batch-Standard.pdf


and some young smart engineer that came up with a clever way to fix a problem that can already be fixed with existing technology, without upsetting too much the current programmers way of working.

I'll take that as a compliment :) Although I'm not that young anymore.
I don't understand the reason to be upset though.

The logical way to design a product, is analyzing your needs, and then choosing the right tools to achieve that. Not choosing your tools and then molding your end product with the tools your have chosen.
I presume that the specs for that plant were decided before the needs were established. Someone decided on PLC's even though it wasn't the best way to do batch mixing.

What do you propose then instead to do batch mixing?
A DCS is overkill for this application and doesn't add value.
Also the choice for PLC's has nothing to do with code-generation.

But even there I have doubts, couldn't what he is doing, be done by calling subroutines with parameters? Just like in C++ when you call a function, give it variables, and it will spit out the processed variables? We use subroutines for clarity, but really it can be a very powerful tool to process repeatable code.

I proposed this to my supervisor once when he tasked me to create code for a machine we were redesigning in-house. I told him we could have one subroutine that would handle ALL the motors. We feed it tags when we call it and it spits out the processed tags. Of course he was not very fond of the idea. Not being able to go to the specific ladder and watch the rungs troubled him deeply. I explained to him that with custom tags, we could group everything related to that motor under one main tag and we could see what was going on by watching that tag, and that the HMI would have all the possible faults anyways. He was not impressed, insisted that we would have to teach all the electrical techs how this functioned. I ended up doing a subroutine for every motor. Now I can only imagine if I had asked a group of programmers to do this...

Ok that's exactly how everyone works (or should work) in process industry: there's one FB for a motor type, another one for a valve-type, also control valve, PID, AI, ...
Then those FB's are called for each instance, while connecting the relevant IO, interlocks, phases, ...

Most experienced programmers already have automated code generation for this part. Or packages like PCS7 have specific tools for it.

The thing that still takes a lot of time is programming all the phases.

I think PLC's evolved greatly since address based programming and claiming that we program the same way we did 20 years ago is obviously coming from someone who didn't program 20 years ago.

Indeed I didn't: I started 17 years ago.
I might have missed the revolution in those previous three years.

Structured text is a perversion, don't ever mention those words.

How about Instruction List / STL? :)

Having an electrician background, I really do understand the stubbornness though. You can visualize the electrical flow from hot to neutral when you read a ladder, and literally see where the problem is. Not the case when calling subroutines with parameters or structured text or addons, or any other way than basic ladder. This one reason why basic ladder will prevail.

I do understand this. But that's a discussion of which language to use, not weather or not to use code generation because that's independent from the language.

Automation is fantastic a long as everything is working like intended. But when things go wrong, it's not the bright young engineer that designed the machine that will be troubleshooting the machine, it's the on-site electrical technicians, and like someone said earlier, they are very visual people. The code can be perfect, very compact, run the machine exactly like it's meant with absolutely no bugs, but when that sensor, cylinder, valve, etc fails, what happens? A bunch of coded text is not going to help your electrical tech... They need simple ladder.

Also here: code-generation can be applied to ladder. Has also been confirmed by other people in this thread.
The key is to have the ladder look very readable and structured.

I have seen many young engineers programming incredible things, like robots to go in hazardous locations, claiming ladder was dead but failing to answer simple questions like, what brand of PLC are you using and what language are you using because there were using a unified way of programming. And that project is prone to failure because its fine and dandy as long as everything is working, but when that part fails, you will be faced with compact computer generated code and no one will be able to fix it.

Not sure who's claiming that ladder is dead in this thread.
And generated code needs to be readable like it's written by a human programmer.

I have also seen software programmers claiming that they can program anything, and fail miserably and financially, trying to program a machine. As long as parts will fail, you will need electrical techs, and they will always need basic ladder because it's how electrical stuff is drawn. Software programmers see network switches, cat5 and stuff that can be programmed, and think "hey, I can do that, my computer has cat5 too!".

Where do the software programmers come in? Machines and plants need to be designed and programmed by automation engineers, not by software people who never set a foot in the plant.

What I do believe is that the new generation of automation engineers will need and have a skillset that includes software and modern development tools.

The push for change we are seeing in our industry to put our PLC's on the internet and bring in software developers to the PLC side is because there is a race right now, and that race is called IOT.

In case you don't know what IOT is, it stands for Internet of Things, it used to be called M2M but it was rebranded. Put simple, its connecting things that are not connected to the internet right now. There is a vision for smart cities. A store coffee machine can order coffee before it runs outs, have pollution sensors on streets, automated lights, such are the claims. I myself find it funny, street lights are already automated with 35$ light sensors... but just like when personal computers were invented, the usage claims were ridiculous... "you can do your grocery list with it", I might be laughing at the next biggest upcoming revolution.

That race is huge, every sector wants to win it, Cellular carriers are in it, PLC companies, most of silicon valley tech giants, on-line stores(yeah on-line stores) and there is of course the open-source community also.

So IOT is why we are seeing all those young engineers claiming there is a disruption of the PLC world coming up, because they are told so. There are forces trying to merge the two worlds or software programming and industrial programming because they want to win the IOT race.

I don't know where you look, but most people I see pushing for Industrial IoT are senior executives at Multinational companies.

And the push for IoT is only making the divide more obvious.

Also there are a lot of ridiculous examples of IoT, and a lot of people pushing it that have no clue what they talk about. The only thing that will matter in the end is how much value an IoT application creates for the customer, and if it's the best/most economic solution to realize it.

Model-based code generation does open up IoT opportunities.
An idea might be to automatically create a semantic model of the machine/plant and expose it over a secured API (like OPC UA) to other applications inside the company. Or take it a bit further and automatically generate the digital twin of the machine/plant. Or the model might be what defines the digital twin.

But that's something separate. The original idea of code generation stands by itself, nothing about IoT needed.
 
One thing I'm missing in this discussion is liability. What or who will be held responsible when an accident happens and the investigators point in the direction of the PLC program in case this program is automatically created?

I think the OP won't like the outcome of that investigation, because in the end it will very likely be the programmer of the generating system...

Good question.

I'm not an expert in HAZOPs and everything related.
But from what I understand you always need to assume that a normal computerized system needs to be considered unreliable.

Critical interlocks need to go through a SIL assesment, and programmed accordingly in a safety PLC. (or old-fashioned with a safety relais)

ExxonMobil already confirmed that they will use a commercial solution on the market today to generated their safety applications directly from the Cause and Effect diagrams.

If there's experts here feel free to correct.
 
I am getting a whiff of: "like "how can I cut out the cost of a programmer???" , but maybe that's just me.

That sounds like trying to remove the programmer.
That's totally not my goal. It's rather to make the programmer more productive, let certain automation investments make more economical sense, increase the amount of automation a company can do for the same budget.

From where I look there will be shortage of automation engineers in the coming years, regardless of how much we improve our tools.

What you describe sounds like perhaps something that's applicable to a process-batch system, mind you I've never worked on/in one so I don't know ****. I could also see this for an OEM manufacturer of equipment, who wanted every machine to be coded the same.

For those of us that work on smaller scale applications and equipment though, I think its a little hard to implement this. Almost every piece of equipment I work on uses different components and configurations. Constantly trying new things to push improvement and get better results.

Because of that every program is a little different, and the ability to get into the nitty-gritty of the code is important.

I understand that. Indeed small specialized applications don't make sense then.

Curious what your situation is that you are tired of writing repetitive code? Do you work for a builder, or something where you don't standardize?

I don't know. Just I wanted to be an automation engineer to automate things. Is there a difference between automating a factory and automating software?

I've mostly worked for SI's, both small and big. Sectors I worked in are very diverse: O&G, Chemicals, Food, Pharma, Steel, Paper. Things I didn't do: automotive, discrete (two projects but very limited), cranes, windmills, powerplants, ...

Something that keeps coming back is that code generation will not make sense in every sector.
I know it does for Chemicals, Food and Pharma.
 
I think the core logic that have the variability of the process must be done outside this program. All the program does is generate bulk code. Which should be tested and verified during commissioning.

At the end of the day the program does not test your process and code. That must still be in accordance with commissioning procedures,sign off sheets and functional specs.

Correct!
 
Here is my opinion on this topic:

Firstly there are a couple of things to consider here. I think mass generating tools are well worth the effort but it depends on the maturity of your standard and the estimation of future roll outs of functions.

Yes! Only works with good standards. I added two standards in the example. One for Siemens STL and one for CoDeSys structured text.
Similar standards can be written for Ladder and other brands.

I have worked on many projects where we built our own interfaces to generate the bulk code , its great, it allows my engineers to focus on the process interlocking and alarming of the system. I would say that generating the skeleton and repetitive tasks is where you get the value.

Another yes! Engineers need to focus on the process, and building the best solution. Writing software is just a tool to accomplish this.
(Ofcourse maintainability is another goal)

I would not do device interlocking or ad hoc alarming at this layer. I would generate the DFBs, DDTs and structure of the PLC program.

ExxonMobil wants to even generate the safety interlocks automatically. And they have put a lot of thought in it.

Depending on the SCADA i would generate the Tag base, objects ect. Again processes are very specific and i want my engineer to be in the software UI that he is going to debug the system in.

Yes that's a weak point in what I built until now.
Once you pass the FAT the workflow becomes more difficult. If the PLCs and IDEs were open then we could integrate, but they aren't at this moment.
Any ideas there are welcome.

The other aspect for me is managing updated versions of functions back into the code generator UI. Standards develop,evolve and improve over time. I have seen many projects where engineers are spending longer trying to fix the previous versions code generator than getting down to what they actually need to do. This process needs to be simple and intuitive.

Yes trying to make this as painless as possible.

First of all templates are almost totally separated from actual generator.

Secondly the templating language/engine is Mozilla Nunjucks: well proven and already has a considerable community around it: https://mozilla.github.io/nunjucks/

The templates are also text-based so you can use a GIT-system to track versions.

And finally anyone that wants can open source the templates created. You could imagine that a company like ExxonMobil throws theirs on github for example.

The last point i would like to raise is re-usability.This concept would work great in big companies, where there is continuous upgrades of old PLCs and always projects installing new ones. This utility will not work for one of PLC developments, the power really is re-usability. And one has to gauge the value of a tool vs. an engineer sitting and doing the code.

Indeed: I find myself having more and more discussions with huge companies with tens to hundreds of plants worldwide. There is a general trend of standardization at those companies.

On the other hand it also works for one-of projects, as long as it is a system integrator working for companies in the same sector. You can even have different systems at different customers, but your workflow stays the same.

I honestly believe you are on to something here, be wary of not trying to replace the vendor software and do all the programming in this tool. Engineers will always fault find in the PLC vendor UI and i do think this is where they key code (interlocking, alarming , sequencing ect) should be done.

No it's not my goal to replace the vendor software.
But it will take opening up of that software to make code generation more practically usable.
Or opening up of the PLCs so independent software vendors can come in.
Code generation should be a tool that adds to it.

Ideally code finding will be extended: you can look at different levels why there's an issue.
 
I want to respond to the comments about the hardware side, and it not keeping up with technology.

"Also the controllers we use are not keeping up with the exponential curves in the tech/enterprise/consumer markets. There are even cases of the hardware being downtuned deliberately…"

If your process is working, and has minimal downtime why would you want to inject new, unproven technology into it. Yes, the newer controllers do have more bells and whistles. But as anyone who has upgraded Windows to the newest version will tell you, there are a lot of unforeseen bugs and glitches in the system. The number one killer of profitability is downtime, if you aren't making your product then you are not generating revenue. There is a reason businesses only upgraded to Windows 7 when XP was no longer supported, and the same is true with PLCs. At my mill we still have several PLC5s running, and they give me very little issue from the PLC itself. They cause almost no downtime, 99.9% of my downtime is due to external problems (sensors, motor controls, mechanical, operators), so why would I upgrade them before I need to. Hell, don't we all know someone or have read a post on here of someone still using PLC2s? When the process requires more computing power, or better connectivity then a controller upgrade becomes a need and not a want.

"If it is not broke, don't fix it!!"

Just my two cents.
 
Taking onboard what Mark said, the only reasons to upgrade a system that is working and producing is really lack of spare parts. When there is only one spare controller available in the world, it's time to upgrade.

Not only that, some applications (although not all) will possibly not work well with super-duper PLC's, requiring additional engineering.

Where I worked before we had S7-317 CPU's running a fairly complex machine. They sold tens of those based on that processor and also got the program running on S7-400H CPU's without many major modifications and problems.

Then one day, they decided to use the latest and greatest from Siemens and move to the S7-319... all of a sudden, code that worked in tens of machines would throw these weird errors... turns out the code was running far too quick for the sampling we were doing on the encoders and calculating acceleration.
Solution??

Add a deadtime delay of 20ms in OB1. Siemens even has a block for this...
 
Originally posted by EdStevens:

Ideally code finding will be extended: you can look at different levels why there's an issue.

Are you inferring that the development environment you are proposing could be used as an active troubleshooting tool; that is, the plc state would be displayed in an active copy of whatever you use to define the process? That would be pretty useful from a troubleshooting standpoint, I would think. Especially if there was an active link to drive the actual lower-level programming environment to the program section of interest.

I am one of those small machine guys. Not very many of any given device or process but a comparatively large number of different devices and processes used in myriad different ways. While I may see value in what is being proposed I don't know that it would benefit me enough to be out on the bleeding edge of something like that. I might gravitate toward it after it is established, either by desire or necessity, but probably not at the "disruptive technology" stage.

Like many of the smaller machine/process guys, not all that much of my time is spent in software development. Most of my time is spent in divining what a customer really needs based on a list of what they think they want, coming up with a concept on how to achieve what they need (after teasing it out of what they think they want) then selecting and implementing hardware to execute what they need. Generally speaking, for me software is the easy part.

Keith
 

Similar Topics

I have Allen Bradley plcs, I have had Circuit breakers and other automation equipment in the past. There's no solid buyers local. How much do you...
Replies
2
Views
189
Hello, I have an automation direct d2 262 plc and C-more HMI EA9T6CL-R. I need to prepare a program, scheduled to be performed on a future date. I...
Replies
1
Views
112
Hello all- I have a unique challenge using a customers Direct logic 06 PLC. This customer has a DC motor operating at 10 RPM which is turning a...
Replies
1
Views
128
Hi, I have been trying to run drive via Sysmac studio. I can ping the drive. I can see the logic bits going on/off as per command. But, drive is...
Replies
21
Views
541
Hello Guys, I am using 1769-L36ERMS PLC by Rockwell which doesn't let me MOV or COP literal text into string datatype? i very well know the...
Replies
13
Views
371
Back
Top Bottom