Reference assign is only allowed to variables of REFERENCE type
An attempt is made to assign a reference value to a variable that is not defined as a reference type.
Define the variable as a REFERENCE type.
PROGRAM PLC_PRG
VAR
i : INT;
I_r : INT;
END_VAR
I_r REF= i;
--> C0140: Reference assign is only allowed to variables of REFERENCE type
I_r : REFERENCE TO INT;