Compiler Error C0141

Message: Reference assign needs variable with write access

Possible error cause: A constant is assigned to the reference assignment.

Error correction: Assign a writable variable.

Example of the error:

PROGRAM MAIN
VAR
    I      : INT;
    refInt : REFERENCE TO INT;
END_VAR

refInt REF= 314;

Message:

C0141: Reference assign needs variable with write access

Error correction:

refInt REF= i;