This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

int16 on modbus script
#1
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
Reply


Messages In This Thread
int16 on modbus script - by CristianAgata - 22.05.2022, 19:02
RE: int16 on modbus script - by admin - 23.05.2022, 05:30
RE: int16 on modbus script - by CristianAgata - 23.05.2022, 10:59
RE: int16 on modbus script - by admin - 23.05.2022, 13:20
RE: int16 on modbus script - by CristianAgata - 23.05.2022, 13:22
RE: int16 on modbus script - by admin - 23.05.2022, 13:23
RE: int16 on modbus script - by CristianAgata - 23.05.2022, 13:26

Forum Jump: