Type Conversion Functions

These are the standard functions for converting a data into another data type:

FunctionClosed A function calculates a result according to the current value of its inputs. A function has no internal data and is not linked to declared instances. Description

any_to_bool

Converts to Boolean.

any_to_dint / any_to_udint

Converts to integer (32-bit - default).

any_to_int / any_to_uint

Converts to 16-bit integer.

any_to_lint / any_to_ulint

Converts to long (64-bit) integer.

any_to_lreal

Converts to double precision real.

any_to_real

Converts to real.

any_to_sint / any_to_usint

Converts to small (8-bit) integer.

any_to_string

Converts to character string.

any_to_time

Converts to time.

NUM_TO_STRING

Converts a number to a string.

These are the standard functions performing conversions in BCD format (*):

Function Description

bcd_to_bin

Converts a BCD value to a binary value.

bin_to_bcd

Converts a binary value to a BCD value.

(*) BCD conversion functions may not be supported by all targets.