Тёмный

ChatGPT and PLC programming 

Jakob Sagatowski
Подписаться 28 тыс.
Просмотров 117 тыс.
50% 1

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
- A donation through PayPal → www.paypal.com/donate/?hosted...
- Becoming a Patron → / sagatowski
Subscribe so you don't miss new videos → ru-vid.com...
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

Наука

Опубликовано:

 

5 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 86   
@Paragonatore1670
@Paragonatore1670 Год назад
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
@SoCalFreelance
@SoCalFreelance Год назад
An entire RU-vid 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.
@KamenTcholakov
@KamenTcholakov Год назад
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.
@garethsmith7628
@garethsmith7628 Год назад
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.
@tommyhuffman7499
@tommyhuffman7499 Год назад
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.
@timzalusky
@timzalusky Год назад
The ladder diagram stuff it outputs is pretty funny, I tried it myself a couple weeks ago, will watch this video in full later!
@drorodriguez2827
@drorodriguez2827 Год назад
very good video, you are right, this can enhance our abilities to do more in shorter time.
@ricky4129
@ricky4129 Год назад
Confidently burping out a slightly WRONG answer. It's so convincing you still need a specialist to tell it's wrong or not 😂
@Letsgobrandon827
@Letsgobrandon827 Год назад
It’s programmed to be a politician
@cod3nam3
@cod3nam3 Год назад
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.
@JakobSagatowski
@JakobSagatowski Год назад
Thanks for the tip!
@Perius
@Perius Год назад
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!
@igormalev2871
@igormalev2871 Год назад
😮😅😊 2:46 2:53
@leeham6230
@leeham6230 Год назад
It's the end of human memory and skills. This is terrifying to me.
@YouToobeism
@YouToobeism Год назад
@Perius said "....and being very precise in my description." The lesson learned by any systems developer reading the specs for a new system to be bid on........ How many times I've sat in meetings listening to in-house "experts" describe how their business works, only to find later that there were many, many exceptions to how things really work. That's why a good systems developer is also a good people person with lots of billable patience.
@alexchiosso221
@alexchiosso221 Год назад
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.
@TheYayabrian
@TheYayabrian Год назад
I can totally see process engineer writing control narrative and GPT based tool converting that into logic. Just a matter of time. Lets see who will do it first, Siemens Emerson, Honeywell or someone else. Now, GPT cannot do whole design for you (for now) but can definitely fill up the gaps and speed up the design process.
@softwaredefinedautomation
@softwaredefinedautomation Год назад
Great video, Jakob!
@JakobSagatowski
@JakobSagatowski Год назад
Glad you enjoyed it
@benid696
@benid696 Год назад
Cool video and amazing what ChatGPT could already do!
@TohidAlizadeh
@TohidAlizadeh Год назад
Very nice Video Jakob 😊
@JakobSagatowski
@JakobSagatowski Год назад
Thanks! 😃
@brunocastronunes
@brunocastronunes Год назад
Very Good!!!
@malikmamen
@malikmamen Год назад
I knew this, I've been asking chatGPT to make program a month ago. And it's working
@The_Nehir.
@The_Nehir. Год назад
Thank you 🙏
@JakobSagatowski
@JakobSagatowski Год назад
Any time!
@griffinkirkland9087
@griffinkirkland9087 Год назад
you are not alone 😂 I've been dreaming and breathing it in and out 😂 every day
@ansonkiek6471
@ansonkiek6471 Год назад
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
@doylepatterson4376
@doylepatterson4376 8 месяцев назад
Great Sense of Humor Jake// That Helps with Hi-Tech " Jelly-Rolls", Haha
@Bulkje
@Bulkje Год назад
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.
@HelioCamposMellodeAndrade
@HelioCamposMellodeAndrade Год назад
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
@HelioCamposMellodeAndrade Год назад
It gives you better answers when you do that. Also, if you think it could continue the answer, ask it to 'continue from line: "the line context"' and it continues from there.
@robertomelo8815
@robertomelo8815 Год назад
good topic
@jancatalinnicoara485
@jancatalinnicoara485 Год назад
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. :)
@villujokinen8490
@villujokinen8490 Год назад
It can make complete ladder logic programs. You just need to define the question well and to ask to give it in XML.
@JakobSagatowski
@JakobSagatowski Год назад
Thanks for the suggestion!
@plantnerdsa
@plantnerdsa Год назад
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.
@MR-nl8xr
@MR-nl8xr Год назад
FunctionBlock>LadderLogic>ScriptedText
@MrDawen1997
@MrDawen1997 Год назад
Actually you can write a program in Ladder, you need to define it as (Ladder Logic)
@larsjordan4459
@larsjordan4459 8 месяцев назад
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.
@espenb4135
@espenb4135 Год назад
You can copy youre code in to chatGPT and ask for hjelp on how to make youre code. It can take long programs. Or you can get help to make functionblocks etc. I have tride it with C, python and codesys
@gothakkar
@gothakkar Год назад
Jakob, you are the Tony Stark of industrial automation, and this video is your Iron Man suit. Keep building those awesome robots! 🤩
@JakobSagatowski
@JakobSagatowski Год назад
Tony Stark of industrial automation!!!! 🤣🤣🤣 This made my week!!! 🤣
@gothakkar
@gothakkar Год назад
@@JakobSagatowski 😜
@user-mu4tz2yn4x
@user-mu4tz2yn4x Год назад
Any idea how to get ladder from it ?
@adrianjenkner2775
@adrianjenkner2775 Год назад
Nice video Jacob. Maybe V2 with C# (and ADS communication to Beckhoff) ?
@JakobSagatowski
@JakobSagatowski Год назад
If I manage to get into ChatGPT 😅 It's overwhelmed 😅
@Skaagarak
@Skaagarak Год назад
I asked it how to connect to Beckhoff PLC using Python and it came up with pyads and example code to connect.
@JakobSagatowski
@JakobSagatowski Год назад
That's awesome! 🥳
@ipadize
@ipadize Год назад
8:05 others probably already mentioned this, but you actually got logged off for some reason^^ happens to me also relatively often
@mesutsirincan5523
@mesutsirincan5523 Год назад
That keyboard caught my attention.. I guess they are pbt keycaps. What's the brand of the keyboard?
@geliasr2562
@geliasr2562 9 месяцев назад
I like the bossa nova as background music
@qzorn4440
@qzorn4440 Год назад
this is a nice show me video. However the true capabilities of ChatGPT would be demonstrated by having more experienced placing the text request to ChatGPT. 😎 Thanks. If you ask ChatGPT the same question twice the second answer might be worded a little different as the AI is still learning. 🥳
@abdulqhader814
@abdulqhader814 11 месяцев назад
I'm the plc programing in auto mechan . what help ai to PLC
@robertboone4798
@robertboone4798 Год назад
Sure, here's an example of a ladder logic program for a smart home using Siemens SIMATIC STEP 7 software and a Siemens S7-1200 PLC. Assumptions: - The smart home includes several devices, such as lights, fans, and air conditioners, which are connected to the PLC. - The PLC receives commands from a user interface to turn specific devices on or off or adjust their settings. - The PLC continuously monitors the status of all devices and reports any changes to the user interface. Ladder Logic Program: | Network | Symbol | Description | | --- | --- | --- | | 1 | I0.0 | Start button | | 1 | Q0.0 | Living room light | | 1 | Q0.1 | Living room fan | | 1 | Q0.2 | Living room AC | | 1 | M0.0 | User interface ready | | 1 | M0.1 | Living room light command | | 1 | M0.2 | Living room fan command | | 1 | M0.3 | Living room AC temperature command | | 1 | M0.4 | Living room light status | | 1 | M0.5 | Living room fan status | | 1 | M0.6 | Living room AC status | | | | | | 1.0 | A | I0.0 | | | | | | 1.1 | A | M0.0 | | | | | | 2.0 | X0.0 | Living room light | | | | | | 2.1 | A | M0.1 | | 2.1 | O | Q0.0 | | 2.1 | A | Q0.0 | | 2.1 | A | M0.4 | | | | | | 3.0 | X0.1 | Living room fan | | | | | | 3.1 | A | M0.2 | | 3.1 | O | Q0.1 | | 3.1 | A | Q0.1 | | 3.1 | A | M0.5 | | | | | | 4.0 | X0.2 | Living room AC | | | | | | 4.1 | A | M0.3 | | 4.1 | A | M0.6 | | 4.1 | O | Q0.2 | | 4.1 | A | Q0.2 | | | | | | 5.0 | X0.3 | Living room AC temperature too high | | | | | | 5.1 | I0.1 | Living room temperature sensor | | 5.1 | GT | 25 | | 5.1 | A | X0.3 | | | | | | 6.0 | X0.4 | Living room AC temperature too low | | | | | | 6.1 | I0.1 | Living room temperature sensor | | 6.1 | LT | 18 | | 6.1 | A | X0.4 | | | | | | 7.0 | X0.5 | Living room AC too long | | | | | | 7.1 | M0.7 | Living room AC timer | | 7.1 | TIM | 00:05 | | 7.1 | A | X0.5 | | | | | | 8.0 | X0.6 | Living room AC too short | | | | | | 8.1 | M0.8 | Living room ? write me a ladder logic smart home program using siemans
@xKrantzzy
@xKrantzzy Год назад
Fun video, never expected it to understand IEC 61131-3 languages! That ladder programming looks about as good as i'm writing it 😂 I agree in the way that this type of AI won't take our jobs directly in the near future. But it can be that makes us much more efficient that what was previously possible, as you said. But if 1 Automation Engineer can now work as fast as 3 current Automation Engineers, then these AIs can make us indirectly loose our jobs. But just like when computers became mainstream and a lot of jobs became obsolete, a lot of new jobs will appear in its place. So I don't see it as a problem either, for a good while at least 😉 Would love to hear a deeper insight about this subject from you in the future. Hade gött!
@ypkapo2
@ypkapo2 Год назад
anazing!
@justinturner93
@justinturner93 Год назад
If you are looking for a video sponsor PLC related. Add a business inquiry email in your about section and I will ping you. Thanks for all you do 👍
@JakobSagatowski
@JakobSagatowski Год назад
It's already added. Cheers!
@abdulqhader814
@abdulqhader814 11 месяцев назад
Goot Morgan sir
@BigTimeCharley1956
@BigTimeCharley1956 Год назад
Am I the only one that noticed the mistake in the LCG random number generator? It should be seed := (seed * A + C) mod M; random_number = seed / M; inside the loop, no?
@PlayAutomation
@PlayAutomation Год назад
Its too bad it buzz out when asked to write in ladder diagram. It might have been simpler to do an IL or XML.
@johngrikis9049
@johngrikis9049 Год назад
You should ask if ST or SCL is better ;)
@BayYolal
@BayYolal Год назад
24:00 oh no :D
@mattweger437
@mattweger437 Год назад
Whelp time to move to the woods and get used to the taste of deer jerky.
@GuyFromJupiter
@GuyFromJupiter Год назад
What's crazy to me is that not only can it write valid code but that it can also modify and troubleshoot the code upon request. And it's not even meant to be good at it, it just happens to be.
@Art0r1a
@Art0r1a Год назад
The company I work for intends to use ChatGPT to fill the gap in manpower instead of hiring additional programmers. I'm not convinced that it'll reduce the workload on us, but we'll see I guess... he's the boss.
@Chiricuazo701
@Chiricuazo701 Месяц назад
Can we get a follow up?
@Aitimoney
@Aitimoney Год назад
I have started trying to use this for Automation Direct PLC. If there is anyone who would like to talk about it over phone let me know.
@powervoodoo
@powervoodoo Год назад
I there, try another video and ask for code in ST but with norma IEC 61131-3 and you love the answer.
@amazlin8271
@amazlin8271 Год назад
Google gives better answers in this case than Chatgpt, you had test and show this point here. In addition your questions were simple, like write for me a function in struct text. Automation is more than one function block. If you ask Chatgpt to give you a design of a while system, including plcs, scada and communications protocols it could not give this design. .
@ashkelly449
@ashkelly449 Год назад
Here we go haven't even graduated yet ai can take my job
@JakobSagatowski
@JakobSagatowski Год назад
😅
@primi22
@primi22 Год назад
Don’t worry, chatgpt cannot, by definition, acquire tacit knowledge, which is where most value in engineering comes from. Also code generation has been around for a while. By the time you get chatgpt to output something usable, you could have configured a code generation tool or rolled your own, which many people have been doing since the 90s.
@iNireus
@iNireus Год назад
Ask it can you write a chatGPT in plc structured text
@niclash
@niclash Год назад
You actually contradicted yourself a bit; When YOU get more productive, someone doesn't get any work at all. I.E if we become 10x more productive eventually, one of two things happens, a) a large portion will not get any work, or b) downward pressure on what one can charge for the output, or a combination of both.
@JakobSagatowski
@JakobSagatowski Год назад
You are assuming the amount of work is constant and will not increase, and that this will not bring more opportunities and shift what we will do instead. From what I can see, there has never been more automation work to do and I don't see it decrease. I can already see me and others doing more work on other value-bringing things instead that are lacking in the world of industrial automation, such as writing proper tests for our code.
@niclash
@niclash Год назад
@@JakobSagatowski True... Although I am looking at the entire IT sector, not only industrial automation.
@nhibbs3
@nhibbs3 Год назад
4026 is coming soon! lol
@paulo.galvao
@paulo.galvao Год назад
It may helps, but it is not perfect
@BigTimeCharley1956
@BigTimeCharley1956 Год назад
Not bad: please describe the scan cycle of a plc The scan cycle is the process by which a PLC (Programmable Logic Controller) periodically reads input data, processes that data, and updates output data. The scan cycle is typically broken down into several steps: Input Scan: The PLC scans the input devices and reads their current state. The input data is then stored in the PLC's memory. Program Execution: The PLC then executes the program stored in its memory. The program uses the input data to make decisions and perform calculations. Output Scan: The PLC scans the output devices and updates their state based on the results of the program execution. The output data is also stored in the PLC's memory. Housekeeping: The PLC performs any necessary housekeeping tasks, such as checking for errors or updating diagnostic information. Repeat: The entire process is repeated, typically at a high frequency, such as every few milliseconds, to ensure that the PLC is continuously monitoring and controlling the process or system. The duration of the scan cycle can vary depending on the PLC model and the complexity of the program, but typically is between 1-10 milliseconds.
@JNET_Reloaded
@JNET_Reloaded Год назад
chat gpt sucks now it only lets you have n number of tries then it shuts down an wants money!
@AFuller2020
@AFuller2020 Год назад
Another loud typer,
@JakobSagatowski
@JakobSagatowski Год назад
Not easy to get old & deaf 😅
Далее
The crazy cost of PLC programming
7:12
Просмотров 13 тыс.
Rule #1 for Programming PLCs
33:00
Просмотров 43 тыс.
skibidi toilet zombie universe 37 ( New Virus)
03:02
Просмотров 1,8 млн
PLC vs IPC - What's the Difference?
3:52
Просмотров 7 тыс.
Open source in industrial automation
12:18
Просмотров 10 тыс.
TwinCAT 4026
39:55
Просмотров 12 тыс.
Stop using global variables!
8:20
Просмотров 10 тыс.