Date_to/dt_to conversions, L-force | plc designer – Lenze PLC Designer PLC Designer (R3-1) User Manual
Page 1071

L-force | PLC Designer
Programming Reference
DMS 4.1 EN 03/2011 TD29
1069
When you perform a type conversion from a larger to a smaller type, you risk losing
some information
For the STRING type variable, the result is a time constant.
Examples in IL:
(*Result is 'T#12ms' *)
(*Result is 300000 *)
(*Result is 12 *)
Examples in ST:
str :=TIME_TO_STRING(T#12ms);
(* Result is T#12ms *)
dw:=TIME_TO_DWORD(T#5m);
(* Result is 300000 *)
si:=TOD_TO_SINT(TOD#00:00:00.012);
(* Result is 12 *)
Examples in FBD:
DATE_TO/DT_TO Conversions
IEC Operator: Converting from the variable type DATE or DATE_AND_TIME to a
different type.
Syntax for the conversion operator:
<date data type>_TO_<data type>
The date will be stored internally in a DWORD in seconds since Jan. 1, 1970. This value
will then be converted.
When you perform a type conversion from a larger to a smaller type, you risk losing
some information
For STRING type variables, the result is the date constant.