FOR IIdx_IN := 0 TO 100 BY 1 DO
APtrBCmdIn[IIdx_IN] := PtrAL_InData + IIdx_IN ;
PtrBSrc := APtrBCmdIn[IIdx_IN];
Tab[IIdx_IN]:=PtrBSrc^;
END_FOR
Declaration APtrBCmdIn: ARRAY[0.445] OF POINTER TO UINT;
Tab: ARRAY[0..445] OF UINT;
PtrAL_InData : POINTER TO UINT; // pointer to start address %IW -> ex: adr(%IW400)
IIdx_IN : BYTE; // index
My problem is that in the tab the values are informed both words......
That is to say, first word of tab the value is correct, second word the value is not that expected, Third word value expected to the second word etc.
Thank you for your help
BR
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I created an FB with enter a pointer on an address %IW (that's why I use adr (%IW400)). I want to collect the values of %IW400 a %IW845 in an integer table
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
FOR IIdx_IN := 0 TO 100 BY 1 DO
APtrBCmdIn[IIdx_IN] := PtrAL_InData + IIdx_IN ;
PtrBSrc := APtrBCmdIn[IIdx_IN];
END_FOR
Declaration APtrBCmdIn: ARRAY[0.445] OF POINTER TO UINT;
Tab: ARRAY[0..445] OF UINT;
PtrAL_InData : POINTER TO UINT; // pointer to start address %IW -> ex: adr(%IW400)
IIdx_IN : BYTE; // index
My problem is that in the tab the values are informed both words......
That is to say, first word of tab the value is correct, second word the value is not that expected, Third word value expected to the second word etc.
Thank you for your help
BR
Pointers are in bytes, so you will have to add 2 * IIdxIn.
Thanks for your answer,
Does that mean I have to concat the data from two pointing addresses and put them in an int?
And in my previous example what is the value of the second word?
All you need is:
Tab AT %IW400 : ARRAY[0..445] OF UINT;
yes the %IW400 is 446 length UINT, the pb is not the length, my first post indicates my problem
I am lost. What are you trying to do?
I created an FB with enter a pointer on an address %IW (that's why I use adr (%IW400)). I want to collect the values of %IW400 a %IW845 in an integer table