SEL_WORD block

Short summary

Name

SEL_WORD

→POU type

→function

Category

IEC-block, SelectEnh

Conform to →IEC-standard

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/add.svg not defined in IEC-standard

Graphical interface

images/download/thumbnails/414782476/SEL_WORD-version-1-modificationdate-1535100539998-api-v2.png

Available since

version 1.21.0 (for logi.CAD 3)

Functionality

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

Inputs, return value


Identifier

→Data type

Description

Inputs:

G

BOOL

selector

IN1

WORD

1st value

IN2

WORD

2nd value

Return value:

WORD


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 : WORD;
result2 : WORD;
END_VAR
result1 := SEL_WORD(G := FALSE, IN0 := WORD#0001, IN1 := WORD#0002); (* The variable 'result1' evaluates to 'WORD#0001'. *)
result2 := SEL_WORD(G := TRUE, IN0 := WORD#0001, IN1 := WORD#0002); (* The variable 'result2' evaluates to 'WORD#0002'. *)
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.