TwinCAT PLC Control: IEC Operators

TIME_TO conversions

Converting from the variable type TIME to a different type: The time will be stored internally in a DWORD in milliseconds. 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 the STRING type variable, the result is a time constant.

Examples in ST:

str :=TIME_TO_STRING(T#12ms); (* Result is 'T#12ms' *)
dw:=TIME_TO_DWORD(T#5m); (* Result is 300000 *)