Chapter 4. Ladder Diagram (LD) ProgrammingGFK-2950C February 2018 1214.6.2 Convert UINT or INT to BCD4When this function receives power flow, it converts the input unsigned(UINT) or signed single-precision integer (INT) data into the equivalent4-digit Binary-Coded-Decimal (BCD) values, which it outputs to Q.This function does not change the original input data. The output data canbe used directly as input for another program function.The function passes power flow when power is received, unless the conversion would result in avalue that is outside the range 0 to 9,999.Tip: Data can be converted to BCD format to drive BCD-encoded LED displays or presets toexternal devices such as high-speed counters.OperandsParameter Description Allowed Operands OptionalIN The UINT or INT value to convert toBCD4.All except S, SA, SB, and SC NoQ The BCD4 equivalent value of the originalUINT or INT value in IN.All except S, SA, SB, and SC NoExample - UINT to BDC4Whenever input %I00002 is set and no errors exist, theUINT at input location %I00017 through %I00032 isconverted to four BCD digits and the result is stored inmemory locations %Q00033 through %Q00048. Coil%M01432 is used to check for successful conversion.Example - INT to BCD4Whenever input %I0002 is set and no errors exist, the INTvalues at input locations %I0017 through %I0032 areconverted to four BCD digits, and the result is stored inmemory locations %Q0033 through %Q0048. Coil %Q1432is used to check for successful conversion.