Can AI Automatically Generate Ladder Logic PLC Programs?

Can AI Automatically Generate Ladder Logic PLC Programs?

In the last issue, we discussed the highlighting solution of AI, and VS Code can also achieve syntax highlighting and code snippet support for IEC 61131-3 Structured Text (ST) language! Some friends left comments:

Can AI Automatically Generate Ladder Logic PLC Programs?Can AI Automatically Generate Ladder Logic PLC Programs?

This time, I will share the test results with everyone:

Can AI Automatically Generate Ladder Logic PLC Programs?

Can AI Automatically Generate Ladder Logic PLC Programs?

DeepSeek Testing

We will still take the PID control core program as an example to test the AI’s ability to output ladder diagrams.

Can AI Automatically Generate Ladder Logic PLC Programs?

Specific program content:

Can AI Automatically Generate Ladder Logic PLC Programs?

From this effect, it has already imitated the ladder diagram to output, but it is in text form instead of the ladder diagram effect.

For example, the connecting lines in the middle are replaced with dashed lines, and different PLC manufacturers have slightly different representations of ladder diagrams, so the output effect is not ideal and cannot be directly copied and pasted.

However, the programming ideas can be referenced, and manual dragging is still required.

Can AI Automatically Generate Ladder Logic PLC Programs?

VS Code + Cline

Then, I gave the same requirement to Cline to provide a solution. Let’s take a look:

Can AI Automatically Generate Ladder Logic PLC Programs?

Although I repeatedly emphasized programming in ladder diagram format, AI still does not recommend using LD. Additionally, the Codesys MCP mainly supports ST language.

Can AI Automatically Generate Ladder Logic PLC Programs?

Although LD is used in the main program here, I think it is acceptable, but after opening the project, can you guess what the specific code looks like?

Can AI Automatically Generate Ladder Logic PLC Programs?

It seems that there is no way, so it is forcibly converted to ST output, but it kindly used the Network structure, which is a segment structure in the ladder diagram.

Then, I continued to try to paste the AI’s network program directly into the LD program, but it couldn’t be pasted at all; essentially, it still generated text types. It seems that there are no issues with text-based languages like ST or STL.

Of course, just as I was about to publish this article, I saw other colleagues generating .awl file formats and importing them into SMART 200. In fact, the core is still text-based output, but some programming software can import it.

Can AI Automatically Generate Ladder Logic PLC Programs?

Can AI Automatically Generate Ladder Logic PLC Programs?

Reason

To understand the specific reasons, we directly asked AI, and its specific answer was as follows:

Can AI Automatically Generate Ladder Logic PLC Programs?

The actual reasons given are very detailed:

Can AI Automatically Generate Ladder Logic PLC Programs?

The main point is that graphical languages are not supported, and manual refinement is recommended. Additionally, as ST is the standard language, AI still does not recommend LD, prioritizing ST. After all, for complex logic, ST has more advantages, and text types are more convenient for copying and pasting, with stronger compatibility.

Similarly, I also asked Deepseek for specific reasons, mainly these points:

Can AI Automatically Generate Ladder Logic PLC Programs?Can AI Automatically Generate Ladder Logic PLC Programs?Can AI Automatically Generate Ladder Logic PLC Programs?

Of course, AI also provided some predictions:

Can AI Automatically Generate Ladder Logic PLC Programs?

So, can AI directly generate LD ladder diagram programs? Currently, it seems it cannot, but it can imitate the network structure of LD to provide specific program reference structures, which is quite valuable. If some software can import text types, it can be converted in this way.

In the end, we still need to adapt well to this trend; ST language is definitely a necessary language skill for our PLC programming engineers. The learning materials for ST language are continuously shared, and friends who have not downloaded can continue to receive them for free!

Can AI Automatically Generate Ladder Logic PLC Programs?

  • 【Video Course】Codesys V3.5 Series Introduction Course(160people have learned)
  • 【Video Course】Codesys SoftMotion Basic Course(49people have learned)
  • 【Video Course】Codesys SoftMotion Electronic Gear Course(19people have learned)
  • 【Video Course】Codesys SoftMotion Electronic Cam Course(16people have learned)
  • 【Video Course】Codesys Library Custom Library Creation(26people have learned)
  • Efficient, Real-time, Flexible: In-depth Analysis of EtherCAT Bus Technology (Final Part)

  • RS232, RS422, and RS485 Serial Communication Technology Comprehensive Analysis (Final Part)

  • Modbus Protocol Comprehensive Analysis (Final Part)

  • Profibus Technology Comprehensive Analysis (Final Part)

  • Profinet Technology Comprehensive Analysis (Final Part)

  • EtherNet/IP Technology Comprehensive Analysis (Final Part)

  • CAN and CANopen Bus Technology Comprehensive Analysis (Final Part)

  • OPC UA Communication Technology Comprehensive Analysis (Final Part)

Can AI Automatically Generate Ladder Logic PLC Programs?

——–END——–

Can AI Automatically Generate Ladder Logic PLC Programs?If you like this article, please share and “like” it and “see it”

Leave a Comment