Logic form inside the PLC

bl4ckic3

Member
Join Date
Jul 2012
Location
BEijing
Posts
1
Hi Guys,
Its the first time I am posting in this forum and I hope I am asking my question correctly .

I want to know how the PLC logic will look like inside the PLC. For example in CodeSys once the logic (Written in FB, LL or ST) gets uploaded to the PLC it will look like a binary file.
Assuming that I wrote a logic in ST language and uploaded to the PLC, does it look like a ST file inside the PLC like this:
http://fdik.org/iec2xml/sample.EXP

Or it will be a binary?

Also It seems that lots of people wrote their own Ladder Logic decompiler but it looks like that there is no universal way to decompile a logic even if they are using standard languages such as Ladder Logic or ST or Function Block.

I want to semantically understand a logic file within the PLC thus I need to decompile it. However If the Logic itself stays in its standard language shape (like the sample link in the top) I will have no problem. But if it is converted to something else (e.g. binary) then it will be a problem for my project.
Any idea in this matter? Do you know any PLC which gets the logic in its original language ? (Structured Text, Ladder Logic or Function Block) Or I am wrong and all the PLCs convert the logic to binary byte codes?

Thanks.
 
I think this will depend on the manufacturer, siemens old S5 was converted into something they called MC5, this was a hex number i.e. BC05 there was a list of the MC5 instructions in one of their manuals so it is assumed that the hex code was used by siemens interpreter software in the processor to run the instructions, this is probably true of most PLC's, it makes sense for the plc to be running an interpreter as this will make it easier to on-line program, for example S5 was downloaded as blocks of MC5 code, when an on-line change was done it would download the complete block into spare memory then at a convienient time remove the header off the old block and point to the new one, this is why on S5 the memory would eventually fill up and a compress had to be done, later they incorporated the compression as part of the download.
It was a bit like how disks work, when a file is deleted only the information on where a file is stored is removed or rather set to inactive that's why you can un-delete files on a disk provided it has not been overwritten.
so I guess that most plc's that can be programmed on-line will have an interpreter rather than compiling an executable.
 
codesys is a real compiling software so it will be a binary file, calling libraries and functions.

Old machines were written just like a basic interpreter, so the original program was in memory in short form, and the software inside called this program and act on it by calling functions inside the software.
 

Similar Topics

"I need to show what I/O point ( both digital and/or analog) trips the system. I am going to use CNTRLGX I/O and processors. This "First out"...
Replies
5
Views
10,947
Any one give solution for this fault. We are using AB Gaurd logix controller(5573s), resent days we are facing major fault in controller...
Replies
1
Views
79
Hello, I am going over some old code from days gone by. I would like the expert to confirm my findings to see if I got it correct. 1. B64:22/3...
Replies
7
Views
495
Hello, I´m having a problem trying to program in Ladder. An output should be trigged by two possible contacts. Take a look on the printscreen...
Replies
5
Views
195
I got my PanelView Plus 7 working with a Micrologix 1500. How would I connect my laptop to the PanelView to view the ladder logic while operating...
Replies
6
Views
212
Back
Top Bottom