TO_DT block
Short summary
Name |
|
→POU type |
|
Category |
|
Conform to →IEC-standard |
not defined in IEC-standard as realized (see "Explicit conversion according to IEC-standard") |
Graphical interface |
|
Available since |
version 1.65.0 (for Neuron Power Engineer) |
Functionality
The blocks serves for explicitly converting the value connected to input IN
into a value of data type DATE_AND_TIME
(also identified as DT
).
If the connected value is within the range of values overlapping for the data type of the input and for the result value DT
, the blocks returns this value. The conversion of the connected value is based on seconds, relative to the lower limit DT#1970-01-01-00:00:00.000_000_000
of DATE_AND_TIME
(see under "Example for usage within ST-editor" and "Range of values for conversions" for lower and upper limits per data type).
Explicit conversion according to IEC-standard
The IEC-standard defines an explicit conversion of the following data types to DATE_AND_TIME
:
LDATE_AND_TIME
This data type LDATE_AND_TIME
is currently not supported in Neuron Power Engineer.
Inputs, return value
|
Identifier |
Description |
|
---|---|---|---|
Inputs: |
|
|
value to be converted |
Return value: |
– |
|
|
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.
Internal error diagnostic for block
The block checks the data type of the value connected to input IN
and the return value before the block is executed.
In case of data type LINT
, ULINT
, REAL
, LREAL
or TIME
and an expected return value < DT#0001-01-01-00:00:00
or > DT#9999-12-31-23:59:59
, the output ENO
of the block is set to value FALSE
(or an equivalent) and the return value is set to the appropriate minimum or maximum value (see under "Range of values for conversions").
Example for usage within ST-editor
The calculated values are evaluated by using the Assert
block.
|
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.
Range of values for conversions
The range of values for the conversions is determined by the lower and upper limit of the data types. This lower and upper limit per data type is listed under "Supported data types (in ST)".Keep the following in mind: The lower limit for DATE
or DATE_AND_TIME
is valid for literals. Due to calculations or conversions, Neuron Power Engineer is able to process and displays values down to DATE#0001-01-01
and DT#0001-01-01-00:00:00.000_000_000
respectively.
The following table lists the literals for IN
for that the block returns the smallest possible return value resp. the largest possible return value (relating to the data type for IN
) that can be processed on all target systems. Depending on your target system it might be possible to use literals resulting in a return value > DT#9999-12-31-23:59:59
.
Data type for IN |
Lower limit |
Upper limit | ||
---|---|---|---|---|
Literal for |
Return value |
Literal for |
Return value |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(1) This return value is valid for the built-in PLC under Windows. Depending on your target system, the return value might differ regarding the TIME
fraction due to the REAL
precision.