22.05.2022, 19:02
(This post was last modified: 22.05.2022, 19:02 by CristianAgata.)
Hi everybody,
I've a problem on a script. I'm tring to read a solar inverter ZCSAzzurro. I've problem on negative number.
I've made this request:
if (res9[2] == nil) then
-- Chiamata potenza rete
res10=nil
res10 = { mb:readregisters(530,dt.int16) }
grp.update('Potenza_rete',(res10[1]))
log("Grind_power",res10)
os.sleep(1.1)
else
--log("timeout!")
mb:close()
end
But in the log I find the number 32767. But if try to make a read in the modbus scheduler I get -27 (right value)
Where am I wronging?
Thanks for who will help me.
BR Cristian
I've a problem on a script. I'm tring to read a solar inverter ZCSAzzurro. I've problem on negative number.
I've made this request:
if (res9[2] == nil) then
-- Chiamata potenza rete
res10=nil
res10 = { mb:readregisters(530,dt.int16) }
grp.update('Potenza_rete',(res10[1]))
log("Grind_power",res10)
os.sleep(1.1)
else
--log("timeout!")
mb:close()
end
But in the log I find the number 32767. But if try to make a read in the modbus scheduler I get -27 (right value)
Where am I wronging?
Thanks for who will help me.
BR Cristian