This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Conversion
#1
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
Reply
#2
Use modbus profile app and in there you have bit converter. Just select the bits you need.
------------------------------
Ctrl+F5
Reply
#3
(12.03.2025, 18:06)Daniel Wrote: Use modbus profile app and in there you have bit converter. Just select the bits you need.

Ok I never saw this function, I check better.
Best regards Cristian

(12.03.2025, 18:06)Daniel Wrote: Use modbus profile app and in there you have bit converter. Just select the bits you need.

I've checked, but I've found a strange behavior... If register type it is Holding register I can insert value bitmask, instead type it os input register the app says to create the bitmask but if I download the profile this parameter there is not. Anyway this solution can work.
Best regards Cristian

p.s. I downloaded the profile edit with notepad++ and works also with type input register. (I think there is a little bug in the app)
Reply
#4
In did it was, re-download the app again from the forum.
------------------------------
Ctrl+F5
Reply
#5
(Yesterday, 11:18)Daniel Wrote: In did it was, re-download the app again from the forum.

Ok thanks so much
Reply


Forum Jump: