Logic Machine Forum
Visualizing Modbus objects - 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: Visualizing Modbus objects (/showthread.php?tid=898)



Visualizing Modbus objects - Rodriguez - 12.07.2017

Hi, 

I am working with the example of writing and reading in the modbus:

http://openrb.com/example-write-modbus-rtu-multimeter-values-to-knxeib-bus-group-addresses/

and generate reading to a meter, my question is: to be able to read the data I got, from another logical machine, how should I work? Through an object or a function?

Thanks.


RE: Visualizing Modbus objects - admin - 12.07.2017

If both LMs have KNX/IP enabled, they will exchange object values automatically.


RE: Visualizing Modbus objects - Rodriguez - 12.07.2017

Thank you, Admin.
But maybe I did not know how to explain myself,
I have a server that reads modbus TCP ip and I need to pass the logic data to this server, how do I do it?


RE: Visualizing Modbus objects - admin - 12.07.2017

Then I don't fully understand your question: does your server support Modbus TCP?


RE: Visualizing Modbus objects - Rodriguez - 13.07.2017

This generating a test to be able to check the Modbus TCP communication, but when I put four data it jumps to the next address and does not take me in data that I send it. What could be failing?
I am using this code: http://openrb.com/lm-as-modbus-tcp-slave

CODE:
if not mb1 then
require('luamodbus')
mb1 = luamodbus.tcp()
mb1:open('192.168.0.10', 502)
mb1:connect()
end


--Data1ModbusTCP
coil = mb1:readcoils(0)
grp.write('5/1/1', coil)

--Dato2ModbusTCP
coil2 = mb1:readcoils(0)
grp.write('5/1/2', coil2)

--Dato3ModbusTCP
register = mb1:readregisters(0)
grp.write('5/1/3', register)

--register2 = mb1:readregisters(0)
--grp.write('5/1/4', register2)


RE: Visualizing Modbus objects - admin - 14.07.2017

Are you running both modbus TCP master and slave on the same LM? Which kind of script are you using to read data - event or resident?


RE: Visualizing Modbus objects - Rodriguez - 17.07.2017

Hi,

No, I am using a logic 2 as a slave and a logic3 as a master, I am reading them through a resident function and writing the data into objects.


RE: Visualizing Modbus objects - admin - 17.07.2017

Can you show both scripts? Keep in mind that if KNX/IP features are enabled on both devices, they will automatically exchange object values.