IS_VALID block

Short summary

Name

IS_VALID

→POU type

→function

Category

Standard (non-safe), Numeric

Conform to →IEC-standard

(tick) no restrictions

Graphical interface

Available since

version 1.35.0 (for Neuron Power Engineer) - initial variant

version 3.8.0 (for library Standard (non-safe)): block moved in this library

Functionality

The block checks the validity of the value entered at input IN.

In case of valid ANY_REAL values, the block returns the value TRUE (or an equivalent). In the case that the value is "Not-a-Number" (NaN) or infinite ("+Inf", "-Inf"), the block returns the value FALSE (or an equivalent).

Inputs, return value

 

Identifier

→Data type

Description

Inputs:

IN

REAL, LREAL
(corresponds to →generic data type ANY_REAL)

input value

Return value:

BOOL

 

Input EN and output ENO are available when →calling the block. See "Execution control: EN, ENO" for information on input EN and output ENO.

See:

Example for usage within ST-editor

PROGRAM Test
   VAR
      result1, result2 : BOOL;
   END_VAR
   result1 := IS_VALID(IN := REAL#1234.567e8);          (* The variable 'result1' evaluates to 'TRUE'. *)
   result2 := IS_VALID(IN := LREAL#1234.56789e-123);    (* The variable 'result2' evaluates to 'TRUE'. *)
END_PROGRAM

When creating your application within the ST-editor, enter a call of a block by typing the text as requested by the syntax or use Content Assist.