__ISVALIDREF

The operator is an extension of the IEC 61131-3 standard.

The operator is used to check whether a reference points to a value. The check is thus comparable with a check for 'unequal to 0' in the case of a pointer variable.

A description of the application and a sample of the use of the operator can be found in the description of the data type REFERENCE.

__ISVALIDREF 1:

Checking interface variables

The operator __ISVALIDREF can only be used for operands of type REFERENCE TO. This operator cannot be used for checking interface variables. To check whether an interface variable was already assigned a function block instance, you can check the interface variable for not equal to 0 (IF iSample <> 0 THEN …).