Step 7 Statement List Calculations

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...
7
Replies
2,510
Views
Hi Eveyone, Does anyone know a good place to get a better understanding of this seal in step style programming. Maybe a video you can point me...
17
Replies
1,131
Views
Reading it, seems like most applications will not be effected. Putting anything directly on the internet is a risk I assume amost everyone in this...
23
Replies
1,605
Views
I have a project in Step7 V5.3 SP2 which I am opening using a purpose built VM, running Windows XP Professional SP2 (SP3 is not supported by Sep7...
12
Replies
736
Views
Top