morkai / h5.modbus

Implementation of the MODBUS IP/ASCII/RTU master and slave over TCP/UDP/Serial for Node.js.
https://miracle.systems/p/h5.modbus
MIT License
28 stars 21 forks source link

h5.modbus with 16bit floating point #11

Closed micha1983 closed 7 years ago

micha1983 commented 8 years ago

HI,

has somebody used h5.modbus with 16bit floating point values? at the moment i'm not sure if it's working, i only see 32bit floating point.

is 16bit possible?

morkai commented 8 years ago

The read/write multiple holding register functions work with instances of Buffer, so it doesn't matter what is in them. You need to read a Buffer and then read 16-bit float with some stackoverflow magic.