Compiler Error C0240

Message

First operand of __QueryPointer must be an interface reference or the instance of a function block

Message Cause

Incorrect operands are passed to the operator __QueryPointer.

Solution

Pass an interface reference or the instance of a function block.

Error Example

PROGRAM PLC_PRG
VAR
 a : INT;
 ITFref : ITF;
 pt : POINTER TO FB;
END_VAR

__QueryPointer(a,pt);

INTERFACE ITF EXTENDS __System.IQueryInterface

--> C0240: First operand of __QueryPointer must be an interface reference or the instance of a function block

Error Correction

__QueryPointer (ITFref, pt);