12.03.2025, 17:54
Hi,
I have a strange modbus that give me a number 2 byte uint (63793). I need to convert it to binary and then take the first 10 bit (from 0bit to 10 bit) and convert again into number. In this case the result number it is 305.
I explain better the conversion
63793 -> 1111 1001 0011 0001 -> 001 0011 0001 -> 305
Can you help me please.
BR Cristian Grassi
I have a strange modbus that give me a number 2 byte uint (63793). I need to convert it to binary and then take the first 10 bit (from 0bit to 10 bit) and convert again into number. In this case the result number it is 305.
I explain better the conversion
63793 -> 1111 1001 0011 0001 -> 001 0011 0001 -> 305
Can you help me please.
BR Cristian Grassi