Siemens step7 pointers

rebetiko

Member
Join Date
Dec 2012
Location
portsmouth
Posts
2
Hi every one.
I am trying to verify the following:
A DINT can be converted to a POINTER by simply shifting the double word left by 3 bits.
i want to prove that DINT 160 results in P#20.0 after a SHL3 on 160.
can some1 prove it by means of an example?
its doing my head ?
1010 0000 = 160 (DINT)
if i do a SHL3 in the above , i get 0000 0000 (?)
but if i do a SHR3 i get 0001 0100 which is 20 (for P#20.0)

so
is it a SHL3 or a SHR3 that converts DIN160 into P#20.0 ?

Many thanks 2 all
 
Hi every one.
I am trying to verify the following:
A DINT can be converted to a POINTER by simply shifting the double word left by 3 bits.
i want to prove that DINT 160 results in P#20.0 after a SHL3 on 160.
can some1 prove it by means of an example?
its doing my head ?
1010 0000 = 160 (DINT)
if i do a SHL3 in the above , i get 0000 0000 (?)
but if i do a SHR3 i get 0001 0100 which is 20 (for P#20.0)

so
is it a SHL3 or a SHR3 that converts DIN160 into P#20.0 ?

Many thanks 2 all
From my head. For starters, you say you use a DINT but your examples shows shifting bytes.

SLD 3 on 1010000, which is actually 2#00000000000000000000000001010000, would produce 2#00000000000000000000001010000000
 
I think 160 is
10100000
A0 in hex

The pointer format is
XXXXXXXXXXXXXXXX.BBB

I think the 160 might already be in the correct format for
0000000000010100.000
P#20.0

Where is the 160 coming from ?

Maybe try
L 160
LAR1

the contents will then be 20.0
 
Last edited:
As aready stated, 160 dec is P#20.0 when shown in pointer format.
The coding for converting to pointer format is as below:

b20.jpg
 

Similar Topics

This is the first time I am working with Simatic Manager Step7 as I started my siemens journey with TIA which is pretty easy and do a lot of stuff...
Replies
3
Views
157
When you download a DB, the values get overwritten by what is in the "actual" column in offline DB. Does this happen at the start of the PLC...
Replies
6
Views
152
I have a word in some DB which I want to load to AR1 and use as a pointer. In order to do this I need to write L DBxy.DBW xy SLD 3 LAR1 I...
Replies
3
Views
544
Hi, I received a Step7 Backup from my client and tried opening this backup but it won't open as there seems to be files missing from the backup...
Replies
11
Views
3,030
Hi! i'm just wondering did there is any chance to change Set Time(TV) on Siemens plc timer without step 7 using c# or python if timer not set in...
Replies
1
Views
1,258
Back
Top Bottom