s7 pointer sfc20 ret_val W16#8329

adamplc

Member
Join Date
Dec 2009
Location
usa
Posts
92
I have a very strange issue and I cannot figure out why it is not working.
I read input of type pointer and store it to local temp type any. I then copy the data from any to my static area of the instance DB using sfc20.
I seem to be getting a return code of W#16#8329.
The help tells me Alignment error when writing a parameter.
This error code indicates that the reference to parameter x is a bit address that is not equal to 0. Please help before I start drinking at work!@.
See the screen shot for code reference and online view.




LAR1 P##Pointer_In

L B#16#10 //ANY-pointer
T LB 0
L B#16#1 //Type bool
T LB 1
L W#16#10 //Length 16 bools
T LW 2
L 0 //instance db
T LW 4
L D [AR1,P#2.0] //area crossing pointer
T LD 6


I can store the data to a temp area of the same data type without ret_val error so this makes no sense to me.
Thx for any help

Screenshot 2021-06-07 133500.jpg Screenshot 2021-06-07 133600.png Screenshot 2021-06-07 134537.png
 
I can't replicate this fault in PLCSIM, but your SFC20 destination block will not resolve to an any pointer of bits so your source should not be bits either.


Which CPU is this running in?
 
315-2EH14-0Ab0 v3.2 is the cpu.
I have tried to read the data as 2 bytes and the same issue.


L B#16#10 //ANY-pointer
T LB 0
L B#16#2 //Type Byte
T LB 1
L W#16#2 //Length Bytes
T LW 2
L 0 //area crossing pointer
T LW 4
L D [AR1,P#2.0]
T LD 6
 
I found my problem.
I should have disclosed my first part of the code I mislabeled the storage of AR2


LAR2 ********** This should be TAR2 not LAR2
T #AR2Store

LAR1 P##Pointer_In

L B#16#10 //ANY-pointer
T LB 0
L B#16#2 //Type Byte
T LB 1
L W#16#2 //Length Bytes
T LW 2
L 0 //instance db
T LW 4
L D [AR1,P#2.0] //area Internal pointer
T LD 6
 

Similar Topics

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
533
I am trying to access the value of a pointer via OPC UA in Codesys. I can share it directly and in a struct but I cant access the value of it when...
Replies
5
Views
1,603
Why does my deconstruction of the input pointer only work with its own instance DB not inside the multi instance FB...See .doc The pointer at the...
Replies
8
Views
2,340
Hi All, in many library function of TiaPortal some data must be write using the pointer format........ eg.: P#DB90.DBX0.0 WORD 10 is it...
Replies
5
Views
2,818
Hi all, i found a post from 2011 talking about bool addressing and was trying to figure out how it works. I am not trying to accomplish something...
Replies
10
Views
2,272
Back
Top Bottom