16.04.2026, 07:14
Using a profile was my first try, but it didn't work. So I tried so solve it with this script.
With this profile I get the value 16967.000. Which is wrong, it should be around 50.
readinputregistervalue() - seems to be the problem.
log:
Code:
{
"manufacturer": "Eastron",
"description": "3-phasiger Energiezähler SDM72D-M",
"mapping": [
{
"name": "Frequency",
"address": 70,
"type": "inputregister",
"bus_datatype": "float32",
"unit": "Hz"
}
]
}With this profile I get the value 16967.000. Which is wrong, it should be around 50.
readinputregistervalue() - seems to be the problem.
Code:
require('luamodbus')
mb = luamodbus.rtu()
mb:open('/dev/RS485', 9600, 'N', 8, 1, 'H')
mb:setslave(20)
mb:connect()
local r1 = mb:readregistervalue(70,"float16")
local r2 = mb:readregistervalue(71,"float16")
local value = mb:readregistervalue(70, "float32")
log(r1, r2, value)
mb:close()log:
Code:
* arg: 1
* number: 0
* arg: 2
* number: 0
* arg: 3
* number: 0