Compiler Error C0161

Message

Border <array bound> of array is no constant value

Message Cause

A variable is specified as an array bound.

Solution

Use constants for the array bounds.

Error Example

PROGRAM PLC_PRG
VAR
 i : INT := 3;
 arr1 : ARRAY[1..i] OF INT;
END_VAR

--> C0161: Border 'i' of array is no constant value

Error Correction

arr1 : ARRAY[1..3] OF INT;