Type Conversion Functions

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: