Siemens S7 STL Symbolic Addressing

Join Date
Sep 2011
Location
Detroit, Michigan
Posts
8
Hello, I am new to Siemens programming. I have been an Allen-Bradley guy for years (20+). I am struggling to understand some of the language barriers / syntax. I am looking for a way to symbolicly address a pointer.

DB1 = Array[1..100] OF Int

I want to fill the Array with Numbers. For ease lets say 1-100

Ok, DB1 is call TestDB and the Array of INTs is myValues

So I can access the first position of the Array and fill it with a value of 1 like so...


L 1
T "TestDB".myValues[1]


But I really want to be able to Index the Array Pointer...
L 1
T myCounterValue

LP01: T #Loop
L myCounterValue
T "TestDB".myValues[myCounterValue]
+MyCounterValue
L #Loop
LOOP LP01

Is there a way of doing this except for knowing the Byte Offset?

Any help is greatly appreciated.
 
SCL is the only way to do the method you want.

The only other method is using STL and calculate offsets. YOu would need to understand S7 pointers and ANY formats and use AR1 instructions.

Search for LAR1's posts he has made literally hundreds of axamples of how to do this on this forum. Start by searching S7 Pointer and you should find him.
 

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
666
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,162
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,212
Back
Top Bottom