Operator ‘__QUERYPOINTER’¶
This operator is an extension of the IEC 61131-3 standard.
At runtime, the operator makes it possible to convert the type of an interface reference of a function block to a pointer. The operator returns a BOOL
result. TRUE
means that CODESYS has performed the conversion successfully.
Attention
For compatibility, the definition of the pointer to be converted must be an extension of the base interface “__SYSTEM.IQueryInterface”.
__QUERYPOINTER (<ITF_Source>, <Pointer_Dest>)
The operator receives an interface reference or a FB instance with the required target types as the first operand and a pointer as the second operand. After processing __QUERYPOINTER
, Pointer_Dest receives the pointer to the reference or instance of a function block that the ITF_Source interface reference currently refers to. Pointer_Dest is not typed and can be cast to any type. You have to make sure of the type. For example, the interface could offer a method that returns a type code.