Closed angiehjort closed 7 years ago
If I understand this correct, you are wondering how you can get the two-complement interpretation of your temperature? Since @psorowka made a pull request, you are able to read the result from the modbus request out of a buffer. From that you can just readInt16
your temperature. Have a look here for more help.
thanks @BauchBeinePoe! it helped (of course it did)
Hi! i'm getting data from a modbus device and negative temperatures show up in node.js application as 65413-something. I can fix it by manually post-processing the inputs like this:
but i wonder if node-modbus already supposed to interpret this correectly on reading the registers. the "two's complement" and so on...
Here is my device i'm reading from http://www.comet-america.com/products/temperature-humidity-pressure-transmitters-and-regulators/web-sensor-p8641-with-poe-four-channels-remote-thermometer-hygrometer/reg-P8641#downloadd
in the instruction manual here page 22 there is a register map (I'm interested in int*10 values):