



NOTICE

If the operand value for a type conversion operator is outside of the value range
of the target data type, then the result output depends on the processor type and
is therefore undefined. This is the case, for example, when a negative operand value
is converted from LREAL
to the target data type UINT
.
Information can be lost when converting from larger data types to smaller data types.




NOTICE

The rounding logic for borderline cases depends on the target system or the FPU (Floating
Point Unit) of the target system. For example, a value of -1.5
can be converted differently on different controllers.
Catch value ranges overflows across the application to program code-independent from the target system.
The IEC61131-3 specification does not provide for overloaded functions.
If you want to program strictly according to IEC61131-3, then you should use the operators
of the syntax <type> _TO_ <another type>
as described in the following sections.
The rules for typed conversions also apply here for overloading.
The operators convert values into other data types, explicitly specifying only a target data type and no initial data type (data type of the operands) ("overloaded conversion").
Overloading is not part of the IEC 61131-3 specification.
-
Call syntax
-
Examples