Compiler Error C0204

Message

Variables of the type BIT must be declared within a VAR_INPUT, VAR_OUTPUT or VAR block

Message Cause

An attempt is made to define a variable of the type BIT or as a VAR_IN_OUT parameter.

Solution

Define variables of the type BIT only within a VAR_INPUT, VAR_OUTPUT or VAR block.

Error Message

FUNCTION_BLOCK FB
VAR_IN_OUT
  b : BIT;
END_VAR

PROGRAM PLC_PRG
VAR
  inst : FB;
END_VAR

--> C0204: Variables of the type BIT must be declared within a VAR_INPUT, VAR_OUTPUT or VAR block