You are on page 1of 7

4/2/2016

Format of the parameter Type POINTER - Entries - Forum - Industry Support - Siemens

Format of the parameter Type POINTER


Created by: rajasekhar at: 8/12/2007 6:26 PM (7 Replies)
Rating

(0)

Thanks 0

Actions

New post

8 Entries
8/12/2007 6:26 PM
rajasekhar

Rate

(0)

Dear Everyone,
I am not able to understand the concept behind the format of pointer.
Step7 help helps me that it is 6Bytes.
Byte 0 and Byte 1 with DB Number or 0
Byte2withMemory Area....and so on.

Advanced Member

Joined: 1/22/2006
Last visit: 11/16/2013
Posts: 72

I could understand thesome applications/uses but could not understand the


above discription.

Rating:
(0)
Suggestion

To thank

Answer

8/12/2007 6:49 PM
Late

Rate

Quote

(0)

Hi Rajasekhar,
POINTER:
References the address of a variable.

https://support.industry.siemens.com/tf/ww/en/posts/format-of-the-parameter-type-pointer/11220/?page=0&pageSize=10

1/7

4/2/2016

Format of the parameter Type POINTER - Entries - Forum - Industry Support - Siemens

Platinum Expert

Joined: 1/7/2006
Last visit: 12/29/2015

A pointer contains an address instead of a value. When you supply a value to a


formal parameter of the parameter type POINTER, you specify an address as
the actual parameter. In STEP 7, you can specify a pointer in the pointer format
or simply as an address (for example, M 50.0). Example of a pointer format for
addressing the data beginning at M 50.0: P#M50.0

Posts: 2705
But you could give also no type of variable:

Rating:
(266)

P#8.7

Load the value of the pointer into


accumulator 1.

MD2

Transfer the pointer to MD2.

I [MD2]

Query the signal state at input bit I 8.7 and

Q [MD2]

assign the signal state to output bit Q 8.7.

Or with a type of variable over the address registers:


L

P# I8.7

LAR1

Load the value of the pointer and the area


identification in accumulator 1.
Load memory area I and the address 8.7
into AR1.

P# Q8.7

Load the value of the pointer and the area


identification in accumulator 1.

LAR2

Load memory area Q and the address


8.7 into AR2.

[AR1, P#0.0]

Query the signal state at input bit I 8.7


and

[AR2, P#1.1]

assign the signal state to output bit Q


10.0.

So this Pointer will give you the opportunity to use a variable Operator in the
mentioned commands so that you can work with variable units.
https://support.industry.siemens.com/tf/ww/en/posts/format-of-the-parameter-type-pointer/11220/?page=0&pageSize=10

2/7

4/2/2016

Format of the parameter Type POINTER - Entries - Forum - Industry Support - Siemens

I hope that the answer will help, if you have still questions, don't hesitate to ask
me.
All the best, Late
Never say never, think in solutions, not in trouble......
Suggestion

To thank

Answer

8/13/2007 2:58 PM
rajasekhar

Rate

Quote

(0)

Dear Late,
I got some information but I want to know about the format....
Suppose there is a DB33, and I could easily know the value inDB33.DBD32 (
just by going on-line )and If I want to know the address of it, How? And how does
it require 6 bytes?

Advanced Member

Also If I want to transfer 33.33 into that location I would do:


Joined: 1/22/2006
Last visit: 11/16/2013
Posts: 72

OPN DB33
L 32
SLD 3

Rating:

T #pointer_1 //pointer_1 is declared as DINT.


L 33.33

(0)

T DBD[#pointer_1] // I want to know how this occupies 6 bytes?


Suggestion

To thank

Answer

8/14/2007 9:32 AM
Wizard

Rate

Quote

(0)

Hi,
Please go to Simatic Manager, go to help.
Search in index for Pointer: Then display 'Format of the Parameter Type Pointer'
Perhaps this will help you.

https://support.industry.siemens.com/tf/ww/en/posts/format-of-the-parameter-type-pointer/11220/?page=0&pageSize=10

3/7

4/2/2016

Format of the parameter Type POINTER - Entries - Forum - Industry Support - Siemens

Platinum Member

Best regards,
Joined: 4/24/2006
Last visit: 4/1/2016

Wizard

Posts: 6170
Rating:
(637)
Suggestion

To thank

Answer

8/14/2007 9:58 AM
Aret

Quote

(0)

Rate
6 bytes are required for following 2 for block number and 4 for pointer.

In your case it would be like 33+P#DBX32.0. But you can't use pointer,
consisting of 6 or 10 bytes directly - you can use only 4-byte pointer. So in you
case it would be like
OPN DB33
L 32
SLD 3 //ACCU now contains P#32.0

Platinum Expert

Joined: 10/31/2005

T #tempptr //temp DINT variable


L DBW[#tempptr] // you read DB33.DBW32

Last visit: 7/15/2015


Posts: 2348
Rating:
(230)
Suggestion

To thank

Answer

8/14/2007 6:19 PM
rajasekhar

Quote

Rate

(0)

Aret

6 bytes are required for following 2 for block number and 4 for pointer.
In your case it would be like 33+P#DBX32.0. But you can't use pointer,
consisting of 6 or 10 bytes directly - you can use only 4-byte pointer. So in
you case it would be like
https://support.industry.siemens.com/tf/ww/en/posts/format-of-the-parameter-type-pointer/11220/?page=0&pageSize=10

4/7

4/2/2016

Format of the parameter Type POINTER - Entries - Forum - Industry Support - Siemens

OPN DB33
L 32
SLD 3 //ACCU now contains P#32.0
T #tempptr //temp DINT variable
L DBW[#tempptr] // you read DB33.DBW32
Advanced Member

Joined: 1/22/2006
Last visit: 11/16/2013

Ok Aret, I got some understanding...one reason may be we should use #tempptr


as DINT and We know that DINT requires 4 bytes and then DB No. 2Bytes total
6Bytes.

Posts: 72
But I want to see them all at once in monitor mode as we would see the other

Rating:

variables...MD20, MW24 like that.....

(0)

Also using Indirect option during monitor mode from STL editor I could see the
address....
Also I want to know when we use the below format...
P##ptr
note double #.
Suggestion

To thank

Answer

8/15/2007 7:49 AM
Aret

Rate

Quote

(0)

Ok, think you have variable


21.0 TEMP anyptr: ANY.
It has some predefined structure and you want to see it's contents. Well, most

Platinum Expert

obivious way - use L instruction with local area like L LW21. It may be good for
debugging, but not too good for making programm. So you have to make
something to decombine ANY parameter.Youcanmakeso

Joined: 10/31/2005
Last visit: 7/15/2015

L P##anyptr // now CPU contains ADDRESS of variable named "anyptr"

https://support.industry.siemens.com/tf/ww/en/posts/format-of-the-parameter-type-pointer/11220/?page=0&pageSize=10

5/7

4/2/2016

Format of the parameter Type POINTER - Entries - Forum - Industry Support - Siemens

Posts: 2348

LAR1 // copy that to addressregister

Rating:
(230)

L W[AR1,P#2.0] // this is repetition factor


L W[AR1,P#4.0] // this is DB number
L D[AR1, P#6.0] // this is pointer to data, that was inside "anyptr"
I would advise you to look through Examples STEP7 on indirect addressing because there is plenty things to mention - actually it's too big for forum. Take a
look on
http://support.automation.siemens.com/WW/view/en/19345299 - think it would
be usefull.
PS. You can use POINTER instead of ANY, but it's not simplier. On the other
hand ANY contains more information and that's why it's better to use ANY.

Last edited by: Aret at: 15.08.2007 07:51


Suggestion

To thank

Answer

10/2/2014 2:55 PM

Rate

Quote

(0)

Min_Moderator
New question published byJtrainor is split to a separate thread with the subject
pointer application examples.
Best regards
Min_Moderator
Moderator

Joined: 9/3/2014
Last visit: 4/1/2016
Posts: 3708
Rating:
(49)
Suggestion

To thank

Answer

https://support.industry.siemens.com/tf/ww/en/posts/format-of-the-parameter-type-pointer/11220/?page=0&pageSize=10

Quote
6/7

4/2/2016

Format of the parameter Type POINTER - Entries - Forum - Industry Support - Siemens

8 Entries

Siemens AG 2016 - Corporate Information | Privacy Policy | Cookie policy | Terms Of Use | Digital ID

https://support.industry.siemens.com/tf/ww/en/posts/format-of-the-parameter-type-pointer/11220/?page=0&pageSize=10

7/7

You might also like