SEL_DT block
Short summary
Name |
SEL_DT |
→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_DT allows the connection with DT only (for IN0 and IN1).
Inputs, return value
|
Identifier |
Description |
|
Inputs: |
G |
BOOL |
selector |
IN1 |
DT |
1st value |
|
IN2 |
DT |
2nd value |
|
Return value: |
– |
DT |
|
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:
"Blocks for safe logic" whether this block is supported for developing safety-relevant applications.
"Highlighting safe logic in the FBD-editor" for the effects when using the block as a block for safe logic .
Example for usage within ST-editor
PROGRAM Test
VAR
result1 : DATE_AND_TIME;
result2 : DATE_AND_TIME;
END_VAR
result1 := SEL_DT(G := FALSE, IN0 := DT#
2014
-
10
-
01
-
05
:
00
:
00
.000_000_000, IN1 := DT#
2014
-
10
-
02
-
08
:
00
:
00
.000_000_000); (* The variable
'result1'
evaluates to
'DT#2014-10-01-05:00:00.000_000_000'
. *)
result2 := SEL_DT(G := TRUE, IN0 := DT#
2014
-
10
-
01
-
05
:
00
:
00
.000_000_000, IN1 := DT#
2014
-
10
-
02
-
08
:
00
:
00
.000_000_000); (* The variable
'result2'
evaluates to
'DT#2014-10-02-08:00:00.000_000_000'
. *)
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.