ChatGPT and PLC programming

preview_player
Показать описание
ChatGPT... ChatGPT... It's been on the news every day for the last two months. I've seen it being used for traditional IT-oriented languages/programming, but the question is: can it be used to do PLC-programming? Let's find out!

Please support this channel by either:
- A donation by using the "Thanks" button under the video

0:00 Introduction
1:40 "Do you know how to do PLC-programming?"
2:25 "Can you write me a PID-controller in Structured Text?"
4:09 "Can you help me write a random number generator in Structured Text?"
5:10 "Is Siemens PLC better than Beckhoff PLC?"
6:00 "What is the difference between a function block and a function?"
7:30 "Can you write me a function block for a Beckhoff EL1008 terminal?"
8:27 "Can you write me a function block in structured text that takes a button-press as input and provide a string of whether the button is pressed as output?"
11:44 "Can you write me a piece of code in structured text, that sets an output to true, five seconds after a button has been pressed?"
12:55 "Can you write me a function block in structured text that transmits a text string over a TCP/IP socket, using Beckhoff's TwinCAT3?"
15:56 "What's the difference Beckhoff's TF6310 and TF6311?"
16:54 "Can I do version control using TwinCAT 3?"
17:44 "Can I do TDD with PLCs?"
19:09 "Why don't automation vendors store source code in plain text?"
20:03 "What are the pros and cons of MQTT vs OPC-UA?"
22:00 "Why do automation vendors charge so much for their development environments?"
22:43 "Can you do a simple program in ladder diagram?"
24:34 "Can I make a Beckhoff PLC talk to a Siemens PLC?"
25:21 "What makes a good automation engineer?"
26:35 "Is Structured Text or Ladder Diagram the best?"
28:35 "Why is it taking Beckhoff so long to release TwinCAT 3.1.4026?"
30:52 Wrap-up

#chatgpt #plc #openai
Рекомендации по теме
Комментарии
Автор

One important thing is also that is designed to hold an conversation. For example if you're not sure about something it wrote or how it would handle a situation (like the button pressed). You can ask it and it will most of the times improve the existing, which is even more magical imo

Paragonatore
Автор

An entire YouTube channel on PLC programming -- fascinating. I actually learned a fair amount on the topic just watching your Q&A session. My background is in INFOSEC so I would be curious on your thoughts about ICS/SCADA security to include advanced PLC attacks like STUXNET.

SoCalFreelance
Автор

If you want it to write ladder just ask it to do it in XML for import.

Same trick also works for translating from, say, AB to Siemens, in ladder - give it XML and ask for XML back.

garethsmith
Автор

Hi Jackob.
Great video on this specific topic.
I was skeptical about ChatGPT OpenAI for Industrial Automation Software Programming.
Now I do believe that it can be a side helper mostly for some particular algorithm integration.
The complexity of the PLC programming related to the processes, , machines, equipments or so specific applications cannot lead to a solution coming from this kind of AI.
Anyway ChatGPT is so impressive and scary at the same time.

alexchiosso
Автор

very good video, you are right, this can enhance our abilities to do more in shorter time.

drorodriguez
Автор

I used ChatGPT during the Christmas holidays to generate some code for my home automations in YAML. To get somewhat usable results, you want to give it very precise instructions.
It didn't understand that it had to turn heating off, when the max temperature was reached. Or to turn it back on if the temperature go below the threshold at a later time.
After a bit of fiddling and being very precise in my descriptions and telling it to fix certain errors, I got a very good starting point that saved me a lot of time writing code.
In the relatively near future I see it as a wonderful tool to help developers.
In the future I can see this as a completely automated factory, where you input text or speech input in one end. The AI makes a bunch of simulations and gives you options of what you want, it then choose manufacturing processes, writes it's own code on the way and spits out a complete physical product in the other end.
Very cool stuff. But remember to not ask for the most efficient machine to fix the world's problems, and tick off the box for auto accept. That's how we get Terminators!

Perius
Автор

Great video. Increadible that it can produce more or less correct structured text. One hint though, at the left you see your past conversations so when restarting you can continue where it crashed.

codnam
Автор

Confidently burping out a slightly WRONG answer. It's so convincing you still need a specialist to tell it's wrong or not 😂

ricky
Автор

Very cool video!

I've used Google Translate as a language study tool for almost a decade. It's been insanely helpful. I see ChatGTP's potential as an extension of this. Want to learn PLC programming? Add to your study routine coming up with challenges, trying to solve them, then asking ChatGTP to solve them and compare.

tommyhuffman
Автор

Nice video!
I asked it about configuring opcua in m241. It went in quite wrong direction. Suggested me to use a expansion module for a different plc (different manufacturer)!

I agree though, it is amazing how much it knows and how well it communicates it.

KamenTcholakov
Автор

The ladder diagram stuff it outputs is pretty funny, I tried it myself a couple weeks ago, will watch this video in full later!

timzalusky
Автор

Hi Jakob,
You can use the history on the left side to bring back the context you had previously added to chatgpt so it remember the correct context you were talking about earlier. I asked get and it said it can't get the context off other conversations.

HelioCamposMellodeAndrade
Автор

Perhaps computer science or c language can be replace some day but plc still had hard time due to many method and internal ladder built by each manufacturer

ansonkiek
Автор

Very Interesting video. Curious as to what your thoughts are regarding ladder and function block programming? what do you think is the future? or do you think Structured Text will take over?

I live in South Africa and here the standard is ladder as it is easier for the electrician to also fault find.

plantnerdsa
Автор

Nice challenge for ChatGPT...One step forward and automation guys are out. :) Just kidding. But anyway, nice to get documentation regarding IL, ST, SFC, FB, FBU, LD. :). And for AI also. :)

jancatalinnicoara
Автор

It can make complete ladder logic programs. You just need to define the question well and to ask to give it in XML.

villujokinen
Автор

Hi Jakob, thanks for the great video. It really made me wanna try it out too. However, my feeling regarding the answers is a bit different compared to yours. I agree they read very comprehensive and "knowledgable". But on second sight they could also have been given in another (probably more general) context using the same pattern. So, my feeling is that they are rather superficial. They read impressive, but do for my taste not exceed the level of a search engine with a good user interface.

larsjordan
Автор

I asked it how to connect to Beckhoff PLC using Python and it came up with pyads and example code to connect.

Skaagarak
Автор

It can generate a start for a project, but ChatGPT can be confidently incorrect. That and personally the code I write (for work) is really dependent on the other code, and not so much on general functions.

Bulkje
Автор

Jakob, you are the Tony Stark of industrial automation, and this video is your Iron Man suit. Keep building those awesome robots! 🤩

gothakkar