Siemens STL Help

Join Date
May 2011
Location
South Carolina
Posts
87
Hello all. I am a newbie when it comes to Siemens and I have looked in the STL programming help but there are some things that isn't explained very well if at all. I will copy and paste a chunk of code and I hope someone can explain what this means.

#IN0 is DB100, I know that, but it says to open DB100 and then transfer AR1 to DB100.DBD0. What is AR1? and what does the following two statements mean? L PID [AR1, P#8.0] T PQD [ AR1 , P#12.0 ].

SET
SAVE
OPN #IN0
TAR1 %DBD0
L %DBD8
LAR1
L PID [ AR1 , P#8.0 ]
T %DBD38
A %DBX41.6
AN %DBX41.5
= %DBX26.6
JCN M000
L DW#16#40000000
T PQD [ AR1 , P#12.0 ]
L B#16#0
T %DBB4
JU M001
 
Where have the percentage signs come from - can you post a screen shot of the code instead of copy/paste. What platform are you using Step7 V5.5 or TIA portal?
 
I am using TIA portal. I have a program, paper copy, and re-creating it in Portal. The program is in a machine we have and the file is too old for Portal to automatically convert it for me and I don't have the Step 7 classic software. The percentage signs were done by the program. I am really lost on the lines involving the registers and PID and PQD instructions. Actually, I should say I am lost on most of it.

Cutline_TIA_.jpg
 
PID refers to Peripheral Input DoubleWord
PQD refers to Peripheral Output DoubleWord

Devices in the hardware config will have a Peripheral Input/Output address.
 
AR1 is Address register 1

AR1 can be used for indirect addressing.

Code:
         L PID [AR1, P#8.0]

Means load the double word from the peripheral address calculated from the contents of AR1 + 8 bytes.
 
This is all part of FC0, if that matters.

So let me start from Line 1.
What is being Set and then Saved?
DB100 is IN0, so they open DB100 for access?
Then it transfers the contents of AR1 to DB100.DBD0? If so, what is the contents of AR1??
Then it loads DB100.DBD8? To where, ACC1?
Then it loads AR1 to ACC1 and moves DBD8 to ACC2?
I am lost after this.....

Cutline_TIA_Part.jpg
 
I believe "SET" when used by itself is used to make sure the following logic after it is evaluated. That's how it was explained to me anyway.

I've never used the "SAVE" so I am referencing the STL cheat sheet. Says "save the RLO in BR Register"

this goes into what the BR bit is, and how its used.
https://support.industry.siemens.co...-in-the-status-word-in-step-7-?dti=0&lc=en-WW

Seems to me the set is used to make the BR bit a 1 previous to the rest of the lines being executed.
 
I have never used TIA for STL (yet) so I dont think I can help much... not to mention I kinda suck at it, but there are a few great books that you need, back in the day I had about 20 machines (S5's and S7's) and most programmed in STL but you can search the books and find most of your questions still apply

https://books.google.com/books?id=V...ce=gbs_ge_summary_r&cad=0#v=onepage&q&f=false

This one is by Hans Berger and it covers a lot Automating with STEP 7 in STL and SCL

If the link above works then you can search the book for the instruction
 
I have another STL question. On lines 95, 97, 99 and 101 on the attached image, what are they doing? For instance, on line 97, are they adding the number 4 to the value in AR1?

Cutline_TIA_Part.jpg
 
L ...
T ...

This LOADS a value
and TRANSFERS that value to somewhere
in this case it loads a value and stores it in the output word.
the 0.0, 4.0, 8.0, 12.0 are offsets from the original address.

If AR1 was 256, you would be writing to PQD256, PQD 260, PQD 264 and PQD 268
 

Similar Topics

Hello, I am working on a project to upgrade some old S5-100U processors. The programs are all uploaded and I don't have descriptors...ugh. Be that...
Replies
4
Views
1,157
I really struggle with STL in Siemens Step 7 Classic. I'll learn chunks, but then I don't use it enough to retain and build on the knowledge. When...
Replies
17
Views
3,207
I need some assistance to any Siemens Gurus' who can help me convert the following from STL to Lad. I have tried all the old tricks I can...
Replies
4
Views
4,292
Hi All, I am a ladder programmer but I have to reverse engineer some STL code. I can't figure out this part. Can anyone help me translate this...
Replies
5
Views
1,658
Hi, I have been given the task of implementing some limited changes to an existing Siemens S7-300 application. The program was created around...
Replies
16
Views
19,111
Back
Top Bottom