BCD_TO_USINT

BCD_TO_USINT

PROGRAM BCD_TO_USINT_DEMO
  VAR
     W: WORD;
        U: USINT;
   END_VAR
 U:= BCD_TO_USINT(IN1:=W);
END_PROGRAM

Function converts a bit array (ANY_BIT) to an integer type. For example, a binary value of 2#0011_0110_1001 is converted to 369 decimal.

InputType Description
IN1 ANY_BITInput value
OutputTypeDescription
UINTOutput value

Conversion of a bit array 2#0001_0002 (decimal 18) to the corresponding integer value of 12.

  • © Energocentrum Plus, s.r.o. 2017 - 2024