LrealIsNaN

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

LrealIsNaN 1: Return value

Name

Type

Description

LrealIsNaN

BOOL

If the return value is TRUE, the value is NaN.

LrealIsNaN 2: Inputs

FUNCTION LrealIsNaN : BOOL
VAR_INPUT
    x        : REFERENCE TO LREAL;
END_VAR

Name

Type

Description

x

REFERENCE TO LREAL

Transfers the value being tested.

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 can lead to potentially dangerous malfunctions of the software concerned!

  • Only use expressly approved NaN values, specifically as control values in motion control and drive control functions.

Notice

Machine damage due to floating point exceptions (FP exceptions)

Comparisons with NaN values can lead to an exception, which result in the runtime stopping and potentially machine damage.

  • Switch off the FP exceptions if NaN values are to be used and processed in the application.

Requirements

Development environment

Target platform

PLC libraries to be integrated (category group)

TwinCAT v3.1.4020

PC or CX (x86, x64, Arm®)

Tc2_Utilities (System) >=3.3.16.0