Jump to content

ChatGPT & PLCs


Flex727

Recommended Posts

Well, that is pretty interesting, and maybe this is the wave of the future, who knows? I'm old and retired, and it probably won't benefit me, but it may be  good for future generations who don't  fully understand the transference of old-school relay logic into PLC -land?

  • Upvote 1
Link to comment
Share on other sites

  • MVP 2023

Very interesting indeed.  I second your recommendation to watch this video so people who aren't familiar with ChatGPT can get a feel for it.

My app engineer has been looking at ChatGPT and feeding it questions about Arduino code for his home projects, and it's very capable.

I had fun watching the video and got the impression that the poster was a big fan of Beckhoff, Structured Text, and Function Block programming.  It answered his initial simpler questions well but when he got more specific it started locking up (due to server overloading) and the replies got more vague or outright incorrect.  

Us old dogs have our feet firmly planted in ladder programming.  If one has previous experience in other languages such as C++ or Python then Structured Text or Function Block is probably easier.  I'd be curious to other user's preferences and opinions on this.

So I made a ChatGPT account and asked it to do some ladder logic on my favorite, the State Machine.

Here's my first try:

image.png.896414c5283fa92f9e8411c5f4ab7287.png

 

I don't know about you guys, but this doesn't look like any ladder code I've ever seen.  Maybe my question was too generic, but the ladder method in the various offerings of IEC-61131-3 that I've used look about the same.  Certainly very readable.

So I got more specific.  Surely ChatGPT was familiar with Allen Bradley.  Here's what I got:

image.thumb.png.8322c894acc62b2aa0f6c5eb1387b934.png

 

Uh, no.  WTF is that?

Of course then I tried Unitronics.  It over-ran the screen so I copied the actual code-

image.png.776a4856b830fe0325b553a5d9bac489.png

Light_Control
IF (State=1) THEN
  OUT_0=0;
  OUT_1=0;
  TMR_0.Start;
END_IF

IF (TMR_0.TimeOut) THEN
  TMR_0.Stop;
  TMR_1.Start;
  OUT_0=0;
  OUT_1=1;
END_IF

IF (TMR_1.TimeOut) THEN
  TMR_1.Stop;
  OUT_0=1;
  OUT_1=0;
  TMR_2.Start;
END_IF

IF (TMR_2.TimeOut) THEN
  TMR_2.Stop;
  State=2;
END_IF

IF (State=2) THEN
  OUT_0=0;
  OUT_1=0;
  TMR_3.Start;
END_IF

IF (TMR_3.TimeOut) THEN
  TMR_3.Stop;
  TMR_4.Start;
  OUT_0=0;
  OUT_1=1;
END_IF

IF (TMR_4.TimeOut) THEN
  TMR_4.Stop;
  OUT_0=1;
  OUT_1=0;
  TMR_5.Start;
END_IF

IF (TMR_5.TimeOut) THEN
  TMR_5.Stop;
  State=1;
END_IF

 

It looks like it over-rode my request for ladder code and wrote something in Java.

 

Overall, I'm not too worried about AI getting into my wallet.  PLCs are too diverse and too specialized for the AI programmers to chase down the subtle details of each brand, language and model.  

Is AI going to do the field startup?  I think not.

That is, until this guy becomes a reality-

image.png.60c961bfbb94d39dd6804777945a3fe5.png

 

Joe T.

 

 

 

 

  • Like 1
  • Upvote 1
Link to comment
Share on other sites

  • MVP 2023

Joe, is it just my interpretation, or did you not notice that the examples given did not actually say they were going to turn on the green?  "When the input is "G" the output changes to RED....."   Got a bit confused there, me thinks. Damn you R2, no traffic's moving at all.

And I'm also curious, young Joe, why have you posted my picture on the forum site?  🙂

cheers, Aus

  • Haha 1
Link to comment
Share on other sites

  • MVP 2023
13 hours ago, Joe Tauser said:

Us old dogs have our feet firmly planted in ladder programming. 

Yes, I really wanted the guy to ask more ladder logic questions.

Yes, ChatGPT is actually really amazing, but real AI it's not. I'm looking forward to future iterations.

Link to comment
Share on other sites

  • 4 months later...

You're correct that while ChatGPT and similar AI language models are impressive in their ability to generate human-like text, they do not possess true intelligence or consciousness. AI models like mine are based on pattern recognition and statistical analysis of vast amounts of data, which allows us to generate responses that can be coherent and contextually relevant.

However, true AI—also known as Artificial General Intelligence (AGI)—refers to machines that can exhibit intelligence across a wide range of tasks and demonstrate human-like understanding and consciousness. Achieving AGI remains an ongoing and challenging goal in the field of artificial intelligence.

Researchers and engineers are continuously working on improving AI models and pushing the boundaries of what they can accomplish. Future iterations are expected to bring advancements in areas such as language understanding, reasoning, problem-solving, and even ethical considerations.

While we can anticipate exciting developments in the future, it's important to manage expectations and recognize that creating machines with human-like intelligence is an ambitious and complex task that may take time to achieve, if it's achievable at all. Nonetheless, the progress made so far is remarkable, and we can eagerly anticipate further advancements in AI technology.

Link to comment
Share on other sites

  • 5 months later...
On 6/2/2023 at 21:24, Flex727 said:

Tình cờ gặp phải điều này và nó đáng để xem. Tôi nghĩ mọi người ở đây sẽ thấy nó thú vị. Liệu công việc của chúng ta có bị AI làm cho lỗi thời? Không nhìn thấy nó trong đời (tôi đã già), nhưng chắc chắn là cuối cùng.

 

I think at work, ChatGPT will only be an effective support tool to complete work more effectively and quickly.

Link to comment
Share on other sites

  • 3 months later...

The convergence of ChatGPT and PLCs sounds like a fascinating blend of cutting-edge AI and industrial automation. Your question about the potential obsolescence of jobs due to AI is a complex one that's been on many minds lately. While it's true that AI has the potential to automate certain tasks, the idea of it completely replacing human workers, especially in our lifetime, seems unlikely.
As you rightly pointed out, we're witnessing the dawn of incredible advancements in AI technology, exemplified by platforms like Stevie AI. These innovations are undoubtedly reshaping industries and revolutionizing the way we work.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.