S7 indirect

OK
If i see in AR1 or AR2 "L0.0" then it points to the temp variables of that FB/FC

If i see "Vxy.z" then it points to a value out the block where the FC is called?
 
Thx now i will try to practice with it.
Probably i will come back with more questions.

Goodnight

After practice
I had one more question about this V stack and L stack

In
Let say AR2 = L 0.0 so 86000000 and AR1 = 0.0

When you do next


LAR1 P#Source //anypointer
L B#16#10
T B[AR1,P#0.0]

L b#16#02
T B[AR1,P#0.0]

L 10
T W[AR1,P#2.0]

L 22
T W[AR1,P#4.0]

TAR2
T D[AR1,P#6.0]

What is this a anypointer P#DB22.DBX0.0??? byte 10
Or isn't this DBX0.0 probably not probably it would be the value from the local stack. But is there someone who knows for sure.
I tested it with L D[AR1,P#6.0] but this gives me 86000000 in Accu1 SO points to Temp 0.0

Thx
 
The any pointer is P#L0.0 byte 10 (but with the DB number set to 22)

Where is this code from ?
 
Last edited:
HI Thim

Will give a try:

LAR1 P#Source //anypointer
//this points to Local stack only starting from Source.
//Source must has been defined as Any and has 10 Bytes.
//So 2 byte reference,2 word reference,1 double word makes
//10 bytes.Its upto you how you use Any Area in local stack.
//It has nothing do with DB reference in that case it would be
//84000000

Is it from Puzzle1

Regards
Manmeet
 
HI Thim

Will give a try:

LAR1 P#Source //anypointer
//this points to Local stack only starting from Source.
//Source must has been defined as Any and has 10 Bytes.
//So 2 byte reference,2 word reference,1 double word makes
//10 bytes.Its upto you how you use Any Area in local stack.
//It has nothing do with DB reference in that case it would be
//84000000

Is it from Puzzle1

Regards
Manmeet

No it is an example of siemens manual where i say that AR1/AR2 has the value 86000000
No puzzle or code from any program

naamloos1.JPG
 
Last edited:
Wow Thim
Thanks for bringing this into notice. I think this has got key to puzzle 3.Great.

You get full information on ANY in STEP7 help if you type:
"Format of the Parameter Type ANY"
From this page ANY is composed of 2 bytes, 2 words, 1 double word.

1st byte of Any denotes Synatx ID (Dont know what is this)
2nd Byte of Any denotes Data Type
1st word consist of repetition factor
2nd word consist of DB number
Double word can be devided into Memory Area ID, Byte and Bit.

In the example you mentioned our goal is : Copy 10 Bytes of data from db22.dbx11.0 is to DB33.DBX202.0 onwards by SFC20.



So first byte of ANY pointer SOURCE is Syntax ID (DOnt know what syntax ID is)
Following code do this:
LAR1 P#Source
L B#16#10
T LB[AR1,P#0.0]

2nd step is to tell the data type and since we want to move bytes (10 Numbers) so our data type is B#16#02

L b#16#02
T LB[AR1,P#1.0]


3rd step is how many bytes we want to move (repetition factor)
We want 10 bytes

L 10
T LW[AR1,P#2.0]


4th step is from which DB number (In our case DB22) This becomes 2nd word of ANY

L22
T LW[AR1,P#4.0]

5th step is to mention Memory Area, Byte number and Bit number in refered memory area.In our case memory area is DB, Byte number is 11, and bit is 0 so

L P#DBX11.0 //here acc1 will have 84000058, 84 for db area and 1011(byte no:11)000 (bit No.0) hence1011000(58)
T LD[AR1,P#6.0]

Similarly for destination and then call SFC 20 which will do its job for you and you are done!!

ANY.JPG
 
Last edited:
Will give a try:
menupop.gif


LAR1 P#Source //anypointer
//this points to Local stack only starting from Source.
//Source must has been defined as Any and has 10 Bytes.
//So 2 byte reference,2 word reference,1 double word makes
//10 bytes.Its upto you how you use Any Area in local stack.
//It has nothing do with DB reference in that case it would be
//84000000

This is wrong boss...

đź“š
 
AR2 is not used in the Siemens example. The area pointer is set using L P#DBX11.0

Yep I know

Se my post before

No it is an example of siemens manual where i say(changed) that AR1/AR2 has the value 86000000:beerchug:

I just wanted to know how the any pointer would be if you would load 86000000 or 87000000 with next command

L D[AR1,P#6.0]


And LD gave me the answer

P#L0.0 byte 10/ P#V0.0 byte 10
 
Last edited:

Similar Topics

Howdy folks, I am an Allen Bradley guy currently living in an Emerson world. Working with Rx3i on PacSystems Machine Edition v. 9.6? i think...
Replies
3
Views
634
Hey, I'm trying to do the following, I have some experience with Citect but can't seem to figure this out. I/O Tag: BoxPos1_ProdNum (Data Type...
Replies
0
Views
588
Hello, I'm very new to programming with absolutely zero schooling in this field and pretty hands off training in my new role, it's been fun...
Replies
4
Views
673
Hi, I have this code: LAR1 P##structy L 0 T LW [AR1,P#0.0] which resets all the bits in this struct called structy...
Replies
1
Views
643
I have upgraded an old RS500 project to Studio 5000, it has thrown multiple errors which I am currently working through. I have looked through...
Replies
8
Views
1,731
Back
Top Bottom