Array direct writting to DataType DintIO in a for loop
I want to have a for loop, writting to OutputN+1, Read InputN+1, compare OutputN+1/InputN+1, save TransStateN+1.
I tried to use the Array function, but cannot mange the right syntax to directly write into DintIO types. Here is a minimal example of my function. I would think the OutputXY, InputXY, TransStateXY would need to be transfered to an Array function?
(*OutputXY == DintIO; InputXY == DintIO; TransStateXY == Bool*)
FOR XY := 1 to AmountSignal do
Random := Random + 5;
OutputXY := Random;
IF (InputXY = Random) THEN
TransStateXY := TRUE;
TransStateXY := FALSE;
UNTIL (TransStateXY) END_REPEAT;
XY := XY + 1;
I am using AC800M with Compact Control Builder 6
I'm not quite sure, if got your question right, but I can's see array functions in your code?
In case you want to write or read DintIO variables, you have to use the following syntax:
where Random == INT or DINT
In case you need index (XY) to the name of variable, yes - I think you have to use array for those variables.