I want to convert a Ladder Diagram to Structured text. Does anyone know if there is a tool or program to do this automatically?
- posted
19 years ago
I want to convert a Ladder Diagram to Structured text. Does anyone know if there is a tool or program to do this automatically?
I wrote something years ago for my MS to convert ladder diagrams to HLL source code. The output is generated using templates, so you should be able to make it output structured text. The ladder diagram editor is in Scheme and the code generator is in C. You're welcome to use it if you like:
I have an existing ladder diagram that I want to convert to Structured Text. I don't want to re-write the whole ladder-diagram in another program. I wrote the ladder diagram in Allen Bradley RSLogix5000.
The point was not that the program would work for you as is, but that you could modify it to produce blocks of ST in response to each ladder element instead of producing blocks of code in response to each ladder element.
If you're not comfortable programming, consider hiring a programmer to make the tool do what you want it to do.
-Mike-
If he doesn't want to re-enter the ladder diagram(s), he would also have to figure out how to convert it from the existing format into the net-list format understood by the code-generator.
Check out Mathcad explorer. Although mathsoft stopped providing this, one could always easily find copies floating around the net!
That brings the problem back to where it started... How to convert the existing ladder diagram into 'something else' (Structured Text or C) I want to run the PLC-code on a PC, so I have to translate the PLC-code (ladder diagram) to something that can be compiled on the PC (C or basic). And the program has to be exactly the same, so I don't want to rewrite the program in C, but I want to convert it with a tool.
Maaike (is a 'she', not a 'he' :))
I had a similar situation with an old OMRON PLC program, but never found a "convertor", so I just re-wrote the program. Please post if you do find such a "convertor".
You mention above you need a "convertor" because you intend to run your PLC-code on a PC. If your open to other methods besides C or basic, then you may be interested in products similar to those offered at
I've been pleased to find that some newer PLC programming software includes conversion ability between different IEC 1131-3 programming languages (structured list, ladder, function block).
Sort of. It brings the problem to "how to get a net-list" of the ladder diagram. A net-list is logically the same as a ladder diagram[1], but the chances are probably slim that your existing toolset can save the ladder diagram in a net-list format that could be easily converted to the form expected by the code generator I wrote.
[1] A net-list contains only the information on connections between objects in the ladder diagram and doesn't contain any "graphical" info on where objects were located on the page.And you don't want to re-draw the ladder diagram either...
Sorry about that. One sometimes wishes that English had a formal gender-neutral third person pronoun that one could use when speaking of somebody with whom one is not familiar.
I guess it all depends on the programming software you used to build the ladder. If you developed the ladder program in anything but an IEC61131-3 environment then you're probably out of luck.
If you used a true IEC61131-3 package, you should be able to save the ladder as a FB, then import that FB as IL/LD/ST..etc.
I you used a non 1131-3, like RS Logix, then I know of now way to do what you ask.
- CH
"The RSLogix 5000 Enterprise Series environment offers an easy-to-use, IEC61131-3 compliant interface" But I don't know how to save the ladder as a FB. Maybe anybody can help me with that?
Maaike
PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.