Це відео не доступне.
Перепрошуємо.

ChatGPT and PLC programming

Поділитися
Вставка
  • Опубліковано 14 сер 2024
  • 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...
    - Becoming a Patron → / sagatowski
    Subscribe so you don't miss new videos → www.youtube.co...
    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

КОМЕНТАРІ • 86

  • @Paragonatore1670
    @Paragonatore1670 Рік тому +7

    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 Рік тому +4

    An entire UA-cam 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.

  • @garethsmith7628
    @garethsmith7628 Рік тому +5

    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.

  • @Perius
    @Perius Рік тому +4

    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.

  • @ricky4129
    @ricky4129 Рік тому +11

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

  • @alexchiosso221
    @alexchiosso221 Рік тому +16

    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 Рік тому +2

      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.

  • @cod3nam3
    @cod3nam3 Рік тому +2

    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.

  • @drorodriguez2827
    @drorodriguez2827 Рік тому +1

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

  • @ansonkiek6471
    @ansonkiek6471 Рік тому +2

    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

  • @HelioCamposMellodeAndrade
    @HelioCamposMellodeAndrade Рік тому +2

    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 Рік тому +1

      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.

  • @tommyhuffman7499
    @tommyhuffman7499 Рік тому +2

    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.

  • @TohidAlizadeh
    @TohidAlizadeh Рік тому +2

    Very nice Video Jakob 😊

  • @villujokinen8490
    @villujokinen8490 Рік тому +2

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

  • @justinturner93
    @justinturner93 Рік тому +1

    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 👍

  • @jancatalinnicoara485
    @jancatalinnicoara485 Рік тому +2

    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. :)

  • @Bulkje
    @Bulkje Рік тому +2

    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.

  • @KamenTcholakov
    @KamenTcholakov Рік тому +1

    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.

  • @plantnerdsa
    @plantnerdsa Рік тому +3

    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

  • @Skaagarak
    @Skaagarak Рік тому +3

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

  • @softwaredefinedautomation
    @softwaredefinedautomation Рік тому +1

    Great video, Jakob!

  • @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!

  • @larsjordan4459
    @larsjordan4459 8 місяців тому +1

    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.

  • @doylepatterson4376
    @doylepatterson4376 8 місяців тому

    Great Sense of Humor Jake// That Helps with Hi-Tech " Jelly-Rolls", Haha

  • @ipadize
    @ipadize Рік тому +2

    8:05 others probably already mentioned this, but you actually got logged off for some reason^^ happens to me also relatively often

  • @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

  • @malikmamen
    @malikmamen Рік тому

    I knew this, I've been asking chatGPT to make program a month ago. And it's working

  • @gothakkar
    @gothakkar Рік тому +5

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

    • @JakobSagatowski
      @JakobSagatowski  Рік тому +1

      Tony Stark of industrial automation!!!! 🤣🤣🤣 This made my week!!! 🤣

    • @gothakkar
      @gothakkar Рік тому

      @@JakobSagatowski 😜

  • @xKrantzzy
    @xKrantzzy Рік тому +5

    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!

  • @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

  • @MrDawen1997
    @MrDawen1997 Рік тому +1

    Actually you can write a program in Ladder, you need to define it as (Ladder Logic)

  • @geliasr2562
    @geliasr2562 9 місяців тому

    I like the bossa nova as background music

  • @abdulqhader814
    @abdulqhader814 11 місяців тому

    I'm the plc programing in auto mechan . what help ai to PLC

  • @The_Nehir.
    @The_Nehir. Рік тому +1

    Thank you 🙏

  • @mesutsirincan5523
    @mesutsirincan5523 Рік тому

    That keyboard caught my attention.. I guess they are pbt keycaps. What's the brand of the keyboard?

  • @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 😅

  • @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?

  • @griffinkirkland9087
    @griffinkirkland9087 Рік тому

    you are not alone 😂
    I've been dreaming and breathing it in and out 😂 every day

  • @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.

  • @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 місяців тому

    Goot Morgan sir

  • @benid696
    @benid696 Рік тому

    Cool video and amazing what ChatGPT could already do!

  • @robertomelo8815
    @robertomelo8815 Рік тому

    good topic

  • @brunocastronunes
    @brunocastronunes Рік тому

    Very Good!!!

  • @BayYolal
    @BayYolal Рік тому

    24:00 oh no :D

  • @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.

  • @user-mu4tz2yn4x
    @user-mu4tz2yn4x Рік тому

    Any idea how to get ladder from it ?

  • @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. .

  • @powervoodoo
    @powervoodoo Рік тому

    I there, try another video and ask for code in ST but with norma IEC 61131-3 and you love the answer.

  • @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.

  • @mattweger437
    @mattweger437 Рік тому +1

    Whelp time to move to the woods and get used to the taste of deer jerky.

  • @johngrikis9049
    @johngrikis9049 Рік тому

    You should ask if ST or SCL is better ;)

  • @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  Рік тому +2

      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.

  • @ypkapo2
    @ypkapo2 Рік тому

    anazing!

  • @iNireus
    @iNireus Рік тому

    Ask it can you write a chatGPT in plc structured text

  • @ashkelly449
    @ashkelly449 Рік тому +1

    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.

  • @nhibbs3
    @nhibbs3 Рік тому

    4026 is coming soon! lol

  • @BigTimeCharley1956
    @BigTimeCharley1956 Рік тому +1

    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.

  • @paulo.galvao
    @paulo.galvao Рік тому

    It may helps, but it is not perfect

  • @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,