BlackZork / mqmgateway

MQTT gateway for modbus networks
GNU Affero General Public License v3.0
48 stars 20 forks source link

Converter usage #74

Closed wtrucci closed 3 hours ago

wtrucci commented 6 hours ago

Hi, I need to read data from modbus registry ad int16 and divide data too. Is it possible to do it? If I use converter I can convert on int16 or divide but not together. Is there a way to do it?

Thanks Regards Walter

BlackZork commented 4 hours ago

Cast to int16, divide by 5 and round to two decimal places:

converter: expr.evaluate("int16(R0)/5", 2)

see exprtk docs for more.

wtrucci commented 3 hours ago

Hi, thanks for tip! Regards Walter