TIME_DINT_TO_STRING: Conversion of a variable to DINT format
Original instructions
Function description
The function TIME_DINT_TO_STRING is used to convert a variable in DINT format (TIME using PL7) into a character string.
The additional parameters EN and ENO can be configured.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD Time1
TIME_DINT_TO_STRING
ST Result_Str
Representation in ST
Representation:
Result_Str := TIME_DINT_TO_STRING(Time1);
Description of parameters
The following table describes the input parameters:
Parameter
Type
Comment
Time1
Duration to convert into character string format.
The following table describes the output parameters:
Parameter
Type
Comment
Result_Str
Result_Str is a string of 15 characters containing a duration in the following format: HHHHHH:MM:SS.D.
Example: ’119304:38:49.5’
Runtime errors
If the string Result_Str is too short to contain the date (length = less than 15 characters), the date is truncated and the bit %S15 is set to 1.