-
-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to read signed float values? #459
Comments
Hi .. I believe that readFloatBE should handle negative and positive values .. no need to calculate the sign yourself. Test Flow of their use (note that modbus nodes have the buffer data in
|
Hi, The sign bit in a floating value is the highest bit of the number so in your case this would be bit 15 in pay[0]
Short explanation:
This should solve your sign issues |
This issue is stale because it has been open 60 days with no activity. It will be closed in 30 days, but can be saved by removing the stale label or commenting. |
I want to read a signed float value. I'm using
Modbus Read
node with quantity set to 2.The function I have is as follows:
This gives me the correct numeric value, however the sign keeps changing randomly. So I figured my logic to calculate the sign is wrong.
How can I read the actual float value with the correct sign?
The text was updated successfully, but these errors were encountered: