Querypointer, L-force | plc designer – Lenze PLC Designer PLC Designer (R3-1) User Manual

Page 1088

Advertising
background image

L-force | PLC Designer

Programming Reference

1086

DMS 4.1 EN 03/2011 TD29

__QUERYPOINTER
This operator is not prescribed by the IEC 61131-3 standard.
At runtime __QUERYPOINTER is assigning an interface reference to a untyped pointer.
The operator returns a result with type BOOL. TRUE implies, that the conversion has
been successfully executed.

Note: For compatibility reasons the definition of the intended interface reference
must be an extension of the base interface __SYSTEM.IQueryInterface and the
compiler version must be >= 3.3.0.20.

Syntax:
__QUERYPOINTER (<ITF_Source>, < Pointer_Dest>)
For the first operand the operator rquires a interface reference or a function block
instance of the intended type and for the second operand a untyped pointer. After
execution of __QUERYPOINTER the Pointer_Dest holds the address of the reference to
the intended interface. In this case the conversion is successful and the result of the
operator returns TRUE. In all other cases the operator returns FALSE. Pointer_Dest is
untyped and can be cast to any type. The actual type has to be ensured by the
programmer. For example the interface could provide a method returning a type code.
Precondition for an explicit conversion is that the ITF_Source is an extension of the
interface __System.IQueryInterface. This interface is provided implicitly and needs no
library.

Advertising