Search code examples
c#modbusopcmodbus-tcp

Nmodbus4 library usage


Allow data types such as float, string , double , long and short in the library called Nmodbus4. But I don't know how to implement for string and float , But integer and Boolean implementation was already done. Please any one can help me to find the solution for this.


Solution

  • Modbus only supports uint and bool data types - this isn't a limitation of the nmodbus4 library. The standard says nothing about storing floating point or string types.

    Most device implementations use floating point by dividing by 10/100/1000 etc, but it's up to you as a user of the library to handle that. You'll need to look through the register table for your device to find how it stores each value.