someone knows if is possible in S7, using the indirect adressing by means of a pointer L P## to read a data struct defined as Array of ten words of INT??
Here's some example processing. You can pass the array to an FC as an array (the size/type must match) or by pointer - the processing inside the FC is the same as arrays are actually passed by pointer as well.
I dont' know if is possible, but I'd like read in local variable STAT a data STRUCT call eg.: ALPHA.
This struct contains simple variables [BOOL,BYTE,STRING,INT etc. etc.]and also anothers STRUCT call eg.: BRAVO.
The struct BRAVO contains a data DINT call CHARLIE and DATA ARRAY [0..10] of INT call DELTA.
Well, If try to do
L P##ALPHA.BRAVO.CHARLIE there isn't problem
but if try
L P##ALPHA.BRAVO.DELTA the command is not accepted.
I know If define the pointer with the starting address of the STRUCT ALPHA and ADD the offset of the variables there isn't problem.
But for me in this way loses completely the advantages of use the data STRUCT.
As you have found out you cannot load a pointer to an element of a structure. You have to write an FC that you pass a pointer to the element of the strucure and the FC extracts the area pointer for you. See the FB in the example attached.