Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched.
Close
Hello,
I would like to save some values in a structure named Test
The structures is
TYPE test :
STRUCT
generalinfo :general; // another structure with 2 variables as string
testfreatures : freatures; // another structure with 2 variables as string
END_STRUCT
END_TYPE
I'm using a pointer to the structure test
VAR
INIValues1 : POINTER TO ARRAY [0..1000] OF STRING;
stTest : test;
END_VAR
Program
INIValues1 := ADR(stTest);
// I want to write the first value of the first structure inside test as follow
INIvalues1^[0].^[0] := 'Test';
How can I mange to do this... I would like later only to replace the struct so my function fits for many different structures.
Lets say later will be like:
if A then
INIValues1 := ADR(stTest);
ELSE
INIValues1 := ADR(stSomething);
END_IF
"Note, something will be also a struct of structures containing strings"
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I would like to save some values in a structure named Test
The structures is
TYPE test :
STRUCT
generalinfo :general; // another structure with 2 variables as string
testfreatures : freatures; // another structure with 2 variables as string
END_STRUCT
END_TYPE
I'm using a pointer to the structure test
VAR
INIValues1 : POINTER TO ARRAY [0..1000] OF STRING;
stTest : test;
END_VAR
Program
INIValues1 := ADR(stTest);
// I want to write the first value of the first structure inside test as follow
INIvalues1^[0].^[0] := 'Test';
How can I mange to do this... I would like later only to replace the struct so my function fits for many different structures.
Lets say later will be like:
if A then
INIValues1 := ADR(stTest);
ELSE
INIValues1 := ADR(stSomething);
END_IF
"Note, something will be also a struct of structures containing strings"