Logic Machine Forum
Modbus SunSpec support - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Modbus SunSpec support (/showthread.php?tid=801)



Modbus SunSpec support - joost001 - 22.05.2017

Does the modbus implementation in LM support the SunSpec Modbus Profile? I have an SMA invertor for my solar panels that I would like to query using the modbus protocol the parameters in attachment.

   

regards,
Joost


RE: Modbus SunSpec support - mlaudren - 22.05.2017

If the modbus bus is not proprietary the LM should be able to handle it.

You can try with this.
Code:
require('luamodbus')
mb = luamodbus.rtu()
mb:open('/dev/RS485', 19200, 'E', 8, 1, 'H') -- change with correct MB settings : speed, parity, stop bit, ...
mb:connect()

if mb ~= nil then
    value = mb:readregisters(40188) -- read AC current register
 log(value)

    mb:close()
end



RE: Modbus SunSpec support - admin - 23.05.2017

The correct address is probably not 40188, but either 187 or 188. You can check this quickly with RTU test. If you want to create a profile, then address_scale field should be used to tell where to read the scaling factor from.