NOT_NULL: Check for UNEQUALS NULL pointer (S7-1200, S7-1500) - STEP 7

FBD (S7-1200, S7-1500)

ft:publication_title
FBD (S7-1200, S7-1500)
Product
STEP 7
Version
V20
Publication date
11/2024
Language
en-US
NOT_NULL: Check for UNEQUALS NULL pointer

Description

You can use the instruction "Check for UNEQUALS NULL pointer" to query whether the VARIANT or the reference does not point to a NULL pointer and therefore points to an object.

The <operand> must have the data type VARIANT or REF_TO <data type>.

Note

VARIANT tag points to an ANY pointer

If the VARIANT tag points to an ANY pointer, the instruction always returns the result RLO = "1" even if the ANY pointer is NULL.

Parameters

The following table shows the parameters of the "Check for UNEQUALS NULL pointer" instruction:

Parameters

Declaration

Data type

Memory area

Description

<operand>

Input

VARIANT or REF_TO <data type>

L (The declaration is possible in the "Input", "InOut" and "Temp" sections of the block interface.)

Operand that is compared for UNEQUALS NULL

OUT

Output

BOOL

I, Q, M, D, L

Result of comparison

For additional information on valid data types, refer to "See also".

Example

The following example shows how the instruction works:

The "TagOut" output is set when the following conditions are fulfilled:

  • The operands "Tag_In1" and "Tag_In2" have signal state "1".

  • The condition of the comparison instruction is fulfilled, i.e. the #Tag_Operand operand points to an object.