SEL_STRING block
Short summary
Name |
SEL_STRING |
→POU type |
|
Category |
|
Conform to →IEC-standard |
no restrictions |
Graphical interface |
|
Available since |
|
Functionality
The block makes a binary selection – analogous to the SEL block. In contrast to that block, SEL_STRING allows the connection with STRING only (for IN0 and IN1).
Inputs, return value
|
Identifier |
Description |
|
Inputs: |
G |
BOOL |
selector |
IN1 |
STRING |
1st value |
|
IN2 |
STRING |
2nd value |
|
Return value: |
– |
STRING |
|
Input EN and output ENO are available when →calling the block. See "Execution control: EN, ENO" for information on input EN and output ENO.
Example for usage within ST-editor
PROGRAM Test
VAR
result1 : STRING[
10
];
result2 : STRING[
10
];
END_VAR
result1 := SEL_STRING(G := FALSE, IN0 :=
'abcd'
, IN1 :=
'efg'
); (* The variable
'result1'
evaluates to
''
abcd
''
. *)
result2 := SEL_STRING(G := TRUE, IN0 :=
'abcd'
, IN1 :=
'efg'
); (* The variable
'result2'
evaluates to
''
efg
''
. *)
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.