Hi,
I'm quite new to pointers and i have a question.
I have made an udt1 of one integer and one timeofday (total of 6 bytes).
I have also a DB with a array[0..15] of udt1.
Now i want to write a function / functionblock that copies the udt to the DB.
Following inputs to the function:
i_udtUDT as UDT1
i_SizeinbytesofUDT1
i_Index as integer; (0-15)
I wanted to use the SFC20 'BLKMOV'. The target pointer is no problem.
But building the source pointer (any) pointing to the udt doesn't work for me.
Is it true you can't make a any pointer to the start adres of an udt?
I don't want something in the function, about the structure of the udt itself.
So not:
L i_index
L i_SizeinbytesofUDT1
*I
ITD
SLW3
LAR1
L udtUDT.iInteger
T DB20[AR1,P#0.0]
L udtUDT.iTime
T DB20[AR1,P#2.0]
I would like it completely independent from the structure of the udt. And copy it to the DB.
So if i change the structure of the udt (for example adding a integer) i only need to change the input parameter size when calling this function.
Is this possible? And if yes, how?
I'll be very grateful.
Regards,
Bvrm
I'm quite new to pointers and i have a question.
I have made an udt1 of one integer and one timeofday (total of 6 bytes).
I have also a DB with a array[0..15] of udt1.
Now i want to write a function / functionblock that copies the udt to the DB.
Following inputs to the function:
i_udtUDT as UDT1
i_SizeinbytesofUDT1
i_Index as integer; (0-15)
I wanted to use the SFC20 'BLKMOV'. The target pointer is no problem.
But building the source pointer (any) pointing to the udt doesn't work for me.
Is it true you can't make a any pointer to the start adres of an udt?
I don't want something in the function, about the structure of the udt itself.
So not:
L i_index
L i_SizeinbytesofUDT1
*I
ITD
SLW3
LAR1
L udtUDT.iInteger
T DB20[AR1,P#0.0]
L udtUDT.iTime
T DB20[AR1,P#2.0]
I would like it completely independent from the structure of the udt. And copy it to the DB.
So if i change the structure of the udt (for example adding a integer) i only need to change the input parameter size when calling this function.
Is this possible? And if yes, how?
I'll be very grateful.
Regards,
Bvrm