I used the instructions at https://docs.arduino.cc/software/plc-ide/tutorials/plc-ide-pin-mapping#array to try and make arrays for my digital input and output pins. I followed the steps in there exactly. And when I try to use the arrays in my program it says "MAIN(6) - error A4141: DIBlock => Not an array" etc.
The code is pretty simple - it takes a pins 0-4 as a binary number and pin 5 as a polarity as input and then sets the corresponding digital output to match the polarity pin. I'm using it as an output expander for a device with too few outputs.
I tried to map the inputs to DIBlock, the outputs to DOBlock, and the selectable pins to DIOBlock
actionIn := DIBlock[0] + 2*DIBlock[1] + 4*DIBLock[2] + 8*DIBlock[3] + 16*DIBlock[4];
IF DIBlock[6] THEN
IF actionIn = 0 THEN
FOR i:=0 TO 7 DO
DOBlock[i]:=0;
END_FOR;
FOR i:=0 TO 11 DO
DIOBlock[i]:=0;
END_FOR;
ELSIF actionIn < 9 THEN
DOBlock[actionIn - 1] := DIBlock[5];
ELSIF actionIn < 21 THEN
DIOBlock[actionIn - 9] := DIBlock[5];
END_IF;
END_IF;
What am I doing wrong?