The following description is a bit daunting, but may help give an insight into what goes on when you pass a pointer and anypointer to a function.
The following call shown in the ladder editor as
Code:
CALL FC 1
p1:=MB7
p2:=P#M 50.0 BYTE 10
actually performs the operations shown below.
Code:
Call
BLD 1
= L 20.0
L 0
T LW 21
L P#M 7.0
T LD 23
L W#16#1002
T LW 27
L 10
T LW 29
L 0
T LW 31
L P#M 50.0
T LD 33
UC FC 1
P#L 21.0
P#L 27.0
BLD 2
End Call
As you can see, prior to calling the function, 0 for the DB is loaded into LW21 and the area pointer to MB7 is loaded into LD23 for the pointer parameter.
Similarly the components of the any pointer are loaded into LW27, LW 29 and LD31. FC1 is then called and the parameters are shown
as area pointers following the UC call statement. (Within the FC, when a parameter is referenced the code actually refers to the area pointers for the parameters).
Pointers and any pointers are passed to FC's by loading
them into local data and then passing a pointer to the local data area they are in. That's the way the Step7 editor works.
Note that the LW addresses used will just depend on what temp variables you have declared. The editor uses
local data following on from your declarations.