TO_BCD_WORD

TO_BCD_WORD

PROGRAM TO_BCD_WORD_DEMO
   VAR
     W: WORD;
        U: UDINT;
   END_VAR
 W:= TO_BCD_WORD(IN1:=U);
END_PROGRAM

The function converts any integer number (ANY_INT) to a binary-coded decimal bit array (WORD). For example, 36 is converted to 2#0011_0110 (54 decimal).

InputType Description
IN1 ANY_INTInput value
OutputTypeDescription
WORDOutput value

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