-
Notifications
You must be signed in to change notification settings - Fork 353
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
Read negative values #168
Comments
Yes, I have same issue when reading negative number because it converts the bit that indicates positive or negative to a whole number |
@Frtrillo, how are you dealing with it? |
Its a workaround but when I get negative values, I do a simple substraction, "modbusvalue"-65536. |
But how do you know that the values are negative? |
Thats up to you, I do it because I know the ranges I should read, so If its value <-10000, I do the substraction |
This a problem is with the meter or with the lib? |
Hi, |
This repo is old. Does anyone suggest a new one? |
Hi there, I just need help to understand if I'm facing a bug, or if this is an equipment problem.
I have a Yg889E and I've implemented the modbus communication with ESP8266. I followed this link to help me through.
However, when the multimeter shows negative values, I don't receive negative values. I tried to evaluate if it is a code problem or if this is a hardware problem.
For example, here is part of my code:
Using ModbusMaster, the bytes conversion using union is correct, however, I'm not sure if is the equipment, or if this is ModbusMaster.
In order to avoid to umount the system, I'm asking here first, maybe someone already faced similar problem with negative values.
The text was updated successfully, but these errors were encountered: