
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:


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


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

Specific program content:

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.

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

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

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?

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.


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

The actual reasons given are very detailed:

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:



Of course, AI also provided some predictions:

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!

- 【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)

——–END——–
If you like this article, please share and “like” it and “see it”