Step 7 Statement List Calculations

Jayden

Member
Join Date
Dec 2007
Location
camperdown
Posts
41
Hi All,

I have a task to decipher a calculation done by one of our S7 PLC's onsite. The problem being that its in statement list, and this programming language is something that i'm not all that familiar with. I have moved the Code into Excel and started to attempt to breakdown the calculations, however i'm not sure how to handle the parts that include the TAK Mnemonic. (I'm not all that sure I even have the first parts correct). I'm hoping someone could have a look at the spread sheet and add the formula's on the Right hand side like I have done. Hopefully then I can see how the statement list calculations are done.

Any help would be greatly appreciated,
 
TAK is just swapping ACCU1 with ACCU2. Values from ACCU1 goes to ACCU2 and values from ACCU2 goes to ACCU1. Important for - and / calculations, not so much for + and *.
Code needs optimization tbh.

Code:
L #sp4
TAK
T LD 62
TAK

Can be replaced with:

Code:
T LD62
L #sp4

In the original code you perform a -R, this value is stored in ACCU1. Then you load #sp4, which pushes the calculation result to ACCU2 and loads the value from #sp4 in ACCU1. After that a TAK is performed which swaps ACCU1 and ACCU2. So the calculation result is in ACCU1 again, which is transferred to LD 62. Then there is another TAK which again swaps ACCU1 and ACCU2 so now the value from #sp4 is back in ACCU1 and ACCU2 contains the calculation result

The far simpler "transfer to LD62 then load #sp4" has the exact same end result.
 

Similar Topics

Hello, I am new on STL programming and there is a syntax that I don't understand, exemple: A #F_P_OUT_OF_RANGE NOT A L 0.2 JCN A7ec I...
Replies
7
Views
1,869
I am having a step7 v5.4 program where the blocks are encrypted and locked. And the manufacturer is stopped the support. Is there any ways to...
Replies
2
Views
170
Good Morning, Hoping someone with some Siemens experience can give me a hand with this one. Customer has a S7-200 cpu, which has a 6GK7...
Replies
0
Views
244
HI! HOW COULD I OBTAIN THE NAMES OF THE STEPS OF A ROUTINE IN SFC LANGUAGE IN STUDIO5000? Or is there a system variable that gives me those...
Replies
0
Views
339
I'm just trying to figure out the right method of adding a DO card to an existing rack. It's not the *next* open slot, but I have to move the AO...
Replies
5
Views
544
Back
Top Bottom