DATE_DINT_TO_STRING: Conversion of a date (DATE PL7) into a character string
Original instructions
Description of the function
The function DATE_DINT_TO_STRING is used to convert a PL7 date (double word) 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 Date1
DATE_DINT_TO_STRING
ST Result_Str
Representation in ST
Representation:
Result_Str:= DATE_DINT_TO_STRING(Date1);
Description of parameters
The following table describes the input parameters:
Parameter
Type
Comment
Date1
PL7 date to convert into character string format.
The following table describes the output parameters:
Parameter
Type
Comment
Result_Str
Result_Str is a string of 10 characters containing a date (not including the time) in the following format: YYYY-MM-DD.
Example: ’2000-12-27’
Runtime errors
If the string Result_Str is too short to contain the date (length = less than 10 characters), the date is truncated and the bit %S15 is set to 1.
If Date1 cannot be interpreted and is not consistent in DATE format, the system bit %S18 is set to 1 and Result_Str =’YYYY-MM-DD’.