andresarmento / modbus-arduino

A library that allows your Arduino to communicate via Modbus protocol, acting as a slave (master in development). Supports serial (RS-232, RS-485) and IP via Ethernet (Modbus IP).
BSD 3-Clause "New" or "Revised" License
453 stars 267 forks source link

Float value support? #18

Open Fohdeesha opened 7 years ago

Fohdeesha commented 7 years ago

Hey, is this project dead these days? I haven't seen much activity this year.

Do you plan on ever adding support for modbus float values? The modbus protocol achieves this by using two 16 bit int registers for the value.

This would save me a lot of time if I could write float values directly from sensors on the arduino to registers. Right now since this library only supports modbus integer registers I have to multiply sensor data by 10 and then divide the result on my modbus master/plc by 10 to get decimal values from sensors.

info - (method 1 is the most popular and would give the greatest compatibility) http://www.digi.com/wiki/developer/index.php/Modbus_Floating_Points

more info - http://www.chipkin.com/how-real-floating-point-and-32-bit-data-is-encoded-in-modbus-rtu-messages/