RealIsNaN

This function tests whether a value is NaN (Not a Number). If the return value is TRUE, the value is NaN.

FUNCTION RealIsNaN : BOOL
VAR_INPUT
    x        : REFERENCE TO REAL;
END_VAR

The following points rank among the main features of NaN values:

The fact that NaN values reproduce themselves when used in further calculations is advantageous in that invalid values cannot be overlooked.

CAUTION

Software malfunctions

NaN values may only be used in PLC libraries, in particular as control values in functions for Motion Control and for drive control, if they are expressly approved! Otherwise NaN values can lead to potentially dangerous malfunctions of the software concerned!

CAUTION

Floating point exceptions

If NaNs are to be used and processed in the application, the FP exceptions must be switched off. Otherwise, comparisons with NaN can lead to an exception, which will cause a stop of the runtime and possible machine damage.

Requirements

Development environment

Target platform

PLC libraries to be integrated (category group)

TwinCAT v3.1.4024.32

PC or CX (x86, x64, ARM)

Tc2_Utilities (System) >= 3.3.50.0