siemens stl I don't understand

Tommycai

Member
Join Date
Aug 2011
Location
KY
Posts
120
O(
L DB70.DBW 2 //Load VIEWING_TOOL_CODE
L 0 //Load 0
<I //Compare VIEWING_TOOL_CODE to be less than 0
)
O(
TAK //Swap ACCUM1 and ACCUM2
L 15 //Load 15
>I //Compare VIEWING_TOOL_CODE to be great than 15
)
JC VTSE //Jump conditionally to VTSE label

L DB70.DBW 2 //Load VIEWING_TOOL_CODE
VTS0: ITD //Convert from INT to DINT
L P#30.0 //Load a pointer of P#30.0
*D //Convert VIEWING_TOOL_CODE to pointer format
L P#30.0 //Load a pointer of P#30.0 (30 byte offset)
+D //Add P#30.0 to VIEWING_TOOL_CODE pointer
T #TC_DBB_NO //Transfer to TC_DBB_NO

L DB70.DBW 2 //Load VIEWING_TOOL_CODE
OPN "Tooling selection DB" //Open TOOLING SELECTION DB
T DBW [#TC_DBB_NO] //Transfer to TOOL_CODE
JU WTS //Jump unconditionally to WTS label

VTSE: L L#0 //Load L#0
JU VTS0 //Jump unconditionally to VTS0 label

why is this code using a pointer to point to P#30.0 and then mulitplying *D and then pointing again and then adding the +D I understand the less than 0 and less than 15 beginning part. If the value is less than 0 or greater than 15 then the code inserts a 0, but I don't get the pointer thing.

I looked up something on siemens website, but i'm still confused.

http://www.automation.siemens.com/WW/forum/guests/PostShow.aspx?PageIndex=1&PostID=48658&Language=en

I appreciate it thank you.
 
L P#30.0
*D

This part is to make a 30 byte jump/spacing in your indexing.
For values from 0 to 15, it'll create a pointer pointing to adress 0 to 450, with a 30 byte jump/spacing between each value. Thus 0 = 0, 1 = 30, 2 = 60, etc etc etc

L P#30.0
+D

This part is to create a 30 byte offset in you indexing.
For values from 0 to 15 and taking into account the previous action, it'll create pointers pointing to adress 30 to 480. Thus for 0 = 30, 1 = 60, 2 = 90, etc etc etc.

The multiplying part is to make your 0 to 15 value ready to use as pointer. Pointers have a special format.

Another way of writing it would be:

L DB70.DBW 2 //Load VIEWING_TOOL_CODE
L 30 // Load index spacing
*I
L 30 // Load index offset
+I
SLD 3 // Create pointer
T #TC_DBB_NO //Transfer to TC_DBB_NO
 
I appreciate the response. Thank you.

Pointers point to the address correct and not the value. How does this help? and is there an easy way to troubleshooting pointers?
 
I appreciate the response. Thank you.

Pointers point to the address correct and not the value. How does this help? and is there an easy way to troubleshooting pointers?

If you go online and 'right click' in the part on the right (ie. where it shows the RLO, STA etc) you can choose to 'show' Indirect which will allow you to see what address a pointer is pointing to.

But... apart from that, there is no real easy way of fault finding on indirect addressing as far as I know.
 
If you go online and 'right click' in the part on the right (ie. where it shows the RLO, STA etc) you can choose to 'show' Indirect which will allow you to see what address a pointer is pointing to.

But... apart from that, there is no real easy way of fault finding on indirect addressing as far as I know.

You can single step the PLC to debug loops/indirect addressing calcs.
 
Hello guys!
I have to make a function block for controling a danfoss vlt 5000 drive with ppo 3 type.
I attach a file with an exemple.I didn't undersand exacly what's happen.Can somebody explain step by step in my example?Just delete my comments and write for every step(line) from the program.
Many thanks.
 
Im also new with STL, can anyone explain this or convert this to LAD or FBD?

AN "M65.4"
A "M34.3"
A "M14.0"
A(
L "DB lavoro".Velocita
L "DB lavoro".Velocita_di_soglia_P
>=D
)
= "M33.3"
 
Hi Workaholic

Your network is saying:
If M65.4 is NOT on
AND
M34.3 is on
AND
M14.0 is on
AND
DB lavoro.Velocita (a speed of some sort in a datablock address)
is GREATER THAN OR EQUAL TO
DB lavoro.Velocita_di_soglia_P
THEN bring on M33.3

;-)
 
Hello guys!
I have to make a function block for controling a danfoss vlt 5000 drive with ppo 3 type.
I attach a file with an exemple.I didn't undersand exacly what's happen.Can somebody explain step by step in my example?Just delete my comments and write for every step(line) from the program.
Many thanks.

I have finnaly succeeded to finish the function for control an danfoss drive with PPO 3 type telgram.Can somebody look on my file(see attachments) and see if the code and comments are good?
Many thanks!
 

Similar Topics

Hi Siemens Experts, I am hoping someone can shed some light on my issue. I have uploaded the code from a S7-300 (317-2PN/DP) using Step 7...
Replies
9
Views
667
I'm having trouble trying to convert this code to ladder, anyone able to help me? A M4.0 A M4.1 A M117.0 AN M17.7 A ( A I38.6 AN I3.7 O ( A M4.5...
Replies
8
Views
1,206
Hello, I am still new to STL. But from what I understand is the JC mnemonic should jump if RLO = 1. If we review both pictures the M0bf RLO = 1...
Replies
5
Views
1,051
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,163
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,214
Back
Top Bottom