Skip to main content

Compiler Error C0222

Message: Outputs can't be of type 'REFERENCE TO'

Possible error cause: An attempt is made to define REFERENCE TO as an output parameter.

Error correction: Do not use REFERENCE TO as an output parameter.

Example 444. Example of the error:
PROGRAM PLC_PRG
VAR
    inst : FB;
END_VAR

Implementation of the function block:

FUNCTION_BLOCK FB
VAR_OUTPUT
    re : REFERENCE TO INT;
END_VAR

Message:

C0222: Outputs can't be of type 'REFERENCE TO'