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,861
My PLC is currently running the program and the process is still live. One of my 1769-if16C cards values are all frozen but the card is not...
Replies
1
Views
88
need to find C bits in the logic. They are hidden someplace! Thank you! Bob
Replies
5
Views
159
Good day everyone. if you have a logic for 3 pumps (lead/lag/off), would you please email it to me? I really appreciate it!
Replies
7
Views
157
Good morning crew! Ok my logic works but I am missing something. When the start button is pushed it should like the red light for 4sec then shut...
Replies
13
Views
352
Back
Top Bottom