Conversion Between Integral Number Types

Definition

Conversion from an integral number type to another number type.

Syntax

<INT data type>_TO_<INT data type>

For information on the integer data type, refer to the chapter Standard Data Types.

Conversion Results

If the number you are converting exceeds the range limit, the first bytes for the number will be ignored.

Example in ST

si := INT_TO_SINT(4223); (* Result is 127 *)

If you save the integer 4223 (16#107f represented hexadecimally) as a SINT variable, it will appear as 127 (16#7f represented hexadecimally).

Example in IL

LD                4223
INT_TO_SINT
ST                si

Example in FBD

G-SE-0024441.1.gif-high.gif