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,903
Hello, I am trying to replicate a piece of logic on the PLC5 onto an SEL RTAC. I am using ladder on SEL and FBD. I am having issue on the ladder...
Replies
9
Views
93
Hello again..trying something on an existing poorly written program and just wanted to double check something system is an A-B MicroLogix 1200 In...
Replies
5
Views
163
Good morning fellow sea captains and wizards, I am being asked to do the above and obtain 4 values from each slave, I know about the MRX and MWX...
Replies
27
Views
610
I have a machine which is undergoing upgradation. As part of the process two SEW drives are being replaced., existing Gen B with new Gen C. The...
Replies
3
Views
193
Back
Top Bottom