STL Indirect/Pointer Questions

stevo

Member
Join Date
Dec 2003
Location
birmingham
Posts
197
Hi Guys,
Hopefully attached is the code i could with some advice on. I believe this code controls the mapping of Internal memory to the Peripheral Area. The Hardware Address of the CP342-2 (ASI) x2 is 120-135 & 140-155 for both I&Q. All sensors/actuators are mapped to or from the Pheripheral area to a Memory area of a predetermined length. I didnt write the Code however im just interested how it does what it does! The Memory Area is MB140 to MB175.

The parts im not getting anywhere fast with are these line's:

L DBB[AR1,P#630.0]

The first part is ok "Load Datablock Byte" But am i right in saying Indirectly to the value in Address register 1, If so how does the pointer affect the value? Does it offset it?

L MB[AR2,P#160.0]

I think what i wrote above applys here also except Indirectly to Memory Byte Area?

T PQB [AR1,P#0.0]

I think this line transfers AR1's Value to Pherpheral Output Byte without any offset?

I would be grateful for any advice anybody could give me on this.

thanks Steve
 
Hi Rolf,
thanks for the detailed explanation. I couldnt place the effect the pointers was having on the code, I was looking at it completely the wrong way :unsure: . I dont think i'd have got to the same result without your help.

Danke
Steve.

P.S do you know of any good pointer literature, The stuff i have doesnt touch anything like the example above?

(y)
 
Last edited:
Hi Rolf,
Having gone over your explanation and read up on Indirect Addressing:book:, i just want to make sure i understand correctly, where you say "Change to pointer = #Temp2 * 8 (SLW3) = 248 = 31.0!"
Am i right in saying that the 248 (11111000) is broken down as follows:

111110 | 00
Byte---| Bit

And because the first bit (Least significant) = 0 - 111110 = 31.0

I hope i'm right

Cheers Steve
 
Hi Steve,

I found this link
on siemens website.

the format for an internal area pointer is:

00000000_00000YYY_YYYYYYYY_YYYYYxxx

where bit 31 = 0; bit 0-2 = Bit ; bit 3 - 18 = Byte.


Cheers

Rolf
 
Hi Rolf,
Thanks for finding the Link, Thats just the sort of information i need.

I've now called back my STL Hans Berger book from a friend (He's had it now for 12 months) :p and im going to put it to good use!

Best regards
Steve
 

Similar Topics

Hi all I need to read the values of many variables from a stl cycle. For example, suppose I have 3 variables: tag1,tag2,tag3. Is it possible to...
Replies
1
Views
1,314
I have this code: L P#0.0 T MD 20 L #Index +D T MD 20 L 32 +D T...
Replies
1
Views
1,643
Hello, Can someone help me with this one? I have an array db1.step.step[1..32] I am making a function in STL that give me the first bit that...
Replies
13
Views
3,122
i am new to simatic manager and i am trying to figure what this part do in the code : A I 5.6 = DB50.DBX 4.6...
Replies
3
Views
144
Hello everyone, can anyone help me with covert the STL code to ladder. Iam using plc s71200. A %DB1.DBX33.7 // angel of vaccum...
Replies
2
Views
219
Back
Top Bottom