The application discloses a method,
system and device for converting ladder diagram language into ST language, comprising the following steps: S1, obtaining
XML text of the ladder diagram language; S2,
parsing the text of the ladder diagram language to obtain a multi-way tree; S3, traversing all first-level nodes of the multi-way tree, and after eliminating nodes irrelevant to the generation of the ST language, composing an element tree
list; S4, formulating a sorting rule, sorting the element tree
list according to the sorting rule to obtain a new
list; and S5, traversing the new list, and calculating an expression of the ST language according to the type of a current node and the connection condition of the current node. The application can realize one-to-one correspondence between the ladder diagram elements and the ST code lines, facilitate
static analysis and
error checking of the code, and increase the portability of the project.