Robert Carlsson
Member
Hey all!
I'm trying to write a FB where I need to transfer 32 byte of I/O data to an array in the FBs DI. The code I am using is this:
bDataLen is the length of the are to be copied (input parameter)
LADDR_IN is the logical start address of the module (input parameter)
abInputData is the array where I want the data to be stored
I only get 0's as input data, even though I know there should be data. After some investigation, I found the data I requred in byte PIB512. My question is: How do I translate this into an Any pointer? As the memory area 16#80 only is "I/O area", how do I know where my input I/O are located and where my output I/O are are located?
[Edit]
I also need to transfer from another array to the output I/O
[/Edit]
I'm trying to write a FB where I need to transfer 32 byte of I/O data to an array in the FBs DI. The code I am using is this:
Code:
LAR1 P##pSrc
L W#16#1002
T W [AR1,P#0.0]
L #bDataLen
T W [AR1,P#2.0]
L 0
T W [AR1,P#4.0]
L #LADDR_IN
L 2
+I
SLD 3
L DW#16#81000000
+D
T D [AR1,P#6.0]
LAR1 P##pDest
L W#16#1002
T W [AR1,P#0.0]
L #bDataLen
T W [AR1,P#2.0]
L DINO
T W [AR1,P#4.0]
L #bDataLen
SLD 3
L P##abInputData
+D
T D [AR1,P#6.0]
CALL "BLKMOV"
SRCBLK :=#pSrc
RET_VAL:=#iReturn
DSTBLK :=#pDest
LADDR_IN is the logical start address of the module (input parameter)
abInputData is the array where I want the data to be stored
I only get 0's as input data, even though I know there should be data. After some investigation, I found the data I requred in byte PIB512. My question is: How do I translate this into an Any pointer? As the memory area 16#80 only is "I/O area", how do I know where my input I/O are located and where my output I/O are are located?
[Edit]
I also need to transfer from another array to the output I/O
[/Edit]
Last edited: