Its is forbidden to implicitly convert from a "larger" type to a "smaller" type (for example from INT to BYTE or from DINT to WORD). Special type conversions are required if one wants to do this. One can basically convert from any elementary type to any other elementary type.
Syntax:
<elem.Typ1>_TO_<elem.Typ2>
Please note that at ...TO_STRING conversions the string is generated left-justified. If it is defined to short, it will be cut from the right side.
See also:
-
BOOL_TO conversions⮫ “BOOL_TO conversions”
-
TO_BOOL conversions⮫ “TO_BOOL conversions”
-
Conversion between integral number types⮫ “Conversion between integral number types”
-
REAL_TO-/ LREAL_TO conversions⮫ “REAL_TO-/ LREAL_TO conversions”
-
TIME_TO/TIME_OF_DAY conversions⮫ “TIME_TO/TIME_OF_DAY conversions”
-
DATE_TO/DT_TO conversions⮫ “DATE_TO/DT_TO conversions”
-
STRING_TO conversions⮫ “STRING_TO conversions”