I have a DL05 with analog input. Connected to the analog side is a 0-10V pot. The value that is written to the PLC memory is in binary and (I presume) is scaled so that 0V = 0 and 10V = 65535. The PLC is connected to a PC via serial modbus and the PC is sending a number which should be in decimal format. I need to compare this number to the binary number produced by the analog module.

I see a conversion instruction for going from BCD to binary but nothing to deal with decimal numbers.

The decimal number coming from the PC is between 0 and 10 with 4 decimal places. Another thought I had was to scale the number from the PC so that it's full range represented 0 - 65535 instead of 0.0000 to 10.0000.

How would you all go after this?

From a precision perspective, I'm good with one decimal place. Could I round the floating point number (4.5692) to (4.6), multiply that by 10 (46), write that to the 05 V memory then use the conversion instruction to go from BCD to binary? I recall from another post that multiplying a decimal with one decimal place by 10 produced it's BCD equivalent. Or I could configure the analog module to write in BCD and not have to convert anything. Will this work?

Thanks

I see a conversion instruction for going from BCD to binary but nothing to deal with decimal numbers.

The decimal number coming from the PC is between 0 and 10 with 4 decimal places. Another thought I had was to scale the number from the PC so that it's full range represented 0 - 65535 instead of 0.0000 to 10.0000.

How would you all go after this?

From a precision perspective, I'm good with one decimal place. Could I round the floating point number (4.5692) to (4.6), multiply that by 10 (46), write that to the 05 V memory then use the conversion instruction to go from BCD to binary? I recall from another post that multiplying a decimal with one decimal place by 10 produced it's BCD equivalent. Or I could configure the analog module to write in BCD and not have to convert anything. Will this work?

Thanks

## Comment