Table of Contents

TO_BCD_LWORD

Function name

TO_BCD_LWORD

ST call

PROGRAM TO_BCD_LWORD_DEMO
  VAR
     L: LWORD;
       U: UDINT;
   END_VAR
 L:= TO_BCD_LWORD(IN1:=U);
END_PROGRAM

Description

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

Inputs

InputType Description
IN1 ANY_INTInput value

Outputs

OutputType Description
LWORDOutput value

Application example