SEL_REAL block

Short summary

Name

SEL_REAL

→POU type

→function

Category

Standard (safe), Select

Conform to →IEC-standard

(tick) no restrictions

Graphical interface

Available since

version 1.21.0 (for Neuron Power Engineer) – initial variant

version 2.0.4 (for library Standard) – changed location (from sub-library SelectEnh to Select)

version 3.8.0 (for library Standard (safe)): block provided in this library

Functionality

The block makes a binary selection – analogous to the SEL block. In contrast to that block, SEL_REAL allows the connection with REAL only (for IN0 and IN1).

Inputs, return value

 

Identifier

→Data type

Description

Inputs:

G

BOOL

selector

IN1

REAL

1st value

IN2

REAL

2nd value

Return value:

REAL

 

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 : REAL;
        result2 : REAL;
    END_VAR
    result1 := SEL_REAL(G := FALSE, IN0 := REAL#1.0, IN1 := REAL#2.0);   (* The variable 'result1' evaluates to 'REAL#1.0'. *)
    result2 := SEL_REAL(G := TRUE, IN0 := REAL#1.0, IN1 := REAL#2.0);    (* The variable 'result2' evaluates to 'REAL#2.0'. *)
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.