PLC lower level question ?

janeDoe

Member
Join Date
Dec 2016
Location
LA
Posts
2
When Siemens PLC STL Code converts to lower level MC7 code ?
Before sending the STL code to PLC or downloading from PLC?

Or correct me if am wrong STL is the lower level asm for PLC ?

2) In PLC When it and how it converts to MC7 code ?
 
Last edited:
STL is the lowest level for the S7 PLC. There is even a booklet available with all the S7 STL instructions and their corresponding bit patterns. LAD and FBD are converted to STL while writing the program. You can always see the result by viewing a block of LAD or FBD code in STL.

Inside the PLC the STL code is further interpreted into the assembly language of the used microprocessor.
 
MC7 is the lowest level machine code, but there's no huge difference between MC7 and STL.

Sometimes you see the MC7 code in the Step7 code editor, when you download a block from a plc with a function call where the editor has no parameter list of, and thus it can't "decompile" the MC7 to STL. Then the editor switches to the MC7 code view, where you can't edit or save anything.
There's also a hidden trick in the Step7 editor that allows you to see the MC7 code, but it's read only.
It helps a little bit to understand how the STL editor compiles to MC7, an why some things are as they are.

For example:
L DB1.DBW0
is internally split into two operations:
OPN DB1
L DBW0

Parameter passing is also an interesting part and looks different, and you see how the pointers are passed to FCs:
UC "R_STRNG"
P#L 37.0
P#L 41.0

Also MC7 does not know of jump-labels, this are only relative address jumps internally.

There are S7 which are MC7 interpreter and others that are compiler machines. And there are processors like the Vipa Speed7 which "speak" MC7 natively.
 

Similar Topics

I'm a beginner in the automation field and I've set up an automation system connecting several devices (datalogger, radio, etc.) via Modbus RS485...
Replies
5
Views
186
Hi everyone, I've attached a 4-20ma level sensor to a PLC input that is configured for current. The PLC reads the range 4-12ma just fine, but...
Replies
35
Views
8,987
HI i would like to know how to get a variable that will store the amount of times a program has been executed. The issue is I have 3 DBs for 1 FB...
Replies
2
Views
45
I haven't encountered problems connecting to a PLC through VM Ware but I am with this particular machine. I'm running Windows 7 on a Windows 10...
Replies
5
Views
81
Hello, As part of our project, we are using an M241 controller. This controller interfaces with an industrial computer and a router via a switch...
Replies
1
Views
37
Back
Top Bottom