Logic Machine Forum
LogicMachine as Modbus RTU multi-slave - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Gateway (https://forum.logicmachine.net/forumdisplay.php?fid=10)
+--- Thread: LogicMachine as Modbus RTU multi-slave (/showthread.php?tid=3552)



LogicMachine as Modbus RTU multi-slave - mortiy - 11.09.2021

Hi,
I have a Ventilation system which uses Modbus RTU to access it’s CO2 sensors.
I want to replace those Modbus sensors with LogicMachine which will read CO2 values from KNX sensors.
Can single LogicMachine pretend to be multiple Modbus slaves?


RE: LogicMachine as Modbus RTU multi-slave - Daniel - 13.09.2021

One RTU can only be one slave.


RE: LogicMachine as Modbus RTU multi-slave - mortiy - 13.09.2021

(13.09.2021, 08:00)Daniel Wrote: One RTU can only be one slave.

Hi Daniel,
Is this protocol (Modbus RTU), hardware (LM5) or software (luamodbus) limitation?


I thought that the process is next:
1. LM5 receives RTU packet
2. Checks if Slave ID matches
3. Sends response, according to requested command


RE: LogicMachine as Modbus RTU multi-slave - Daniel - 13.09.2021

In theory this is possible but this will require modbus library modification. As this is rarely used feature we are not planning this.


RE: LogicMachine as Modbus RTU multi-slave - mortiy - 13.09.2021

(13.09.2021, 10:24)Daniel Wrote: In theory this is possible but this will require modbus library modification. As this is rarely used feature we are not planning this.

Ok, thank you.

Do you have any manuals about compiling C libs (for LM5) for further usage inside LUA modules?


RE: LogicMachine as Modbus RTU multi-slave - admin - 14.09.2021

Unfortunately we do not provide compilation tools. Which library do you want to use? If it's easy enough to compile then we can provide a ready package for it.


RE: LogicMachine as Modbus RTU multi-slave - mortiy - 14.09.2021

(14.09.2021, 07:48)admin Wrote: Unfortunately we do not provide compilation tools. Which library do you want to use? If it's easy enough to compile then we can provide a ready package for it.

Hi,

I just want to fix, what already exists (at least for myself). 
I'm going to modify and compile libmodbus with multi-slave support + rebuild lua-libmodbus, if needed.

1. I would be grateful, if you can provided specific gcc compile/optimization flags you are using (if there are any).
2. What is recommended way of installing updated library into system?
Do I have direct access to file-system or only ipk package will work?
(my LM5 on the way, so I can't check that by myself now, and I don't want to break your http://4n.lv:7999)


RE: LogicMachine as Modbus RTU multi-slave - admin - 14.09.2021

We do not use lua-libmodbus but our own Lua library. Accessing the filesystem and custom package compilation is out of standard support scope.
Maybe if you don't have many registers it would be easier to implement modbus using the serial library purely in Lua.


RE: LogicMachine as Modbus RTU multi-slave - mortiy - 14.09.2021

(14.09.2021, 12:40)admin Wrote: We do not use lua-libmodbus but our own Lua library. Accessing the filesystem and custom package compilation is out of standard support scope.
Maybe if you don't have many registers it would be easier to implement modbus using the serial library purely in Lua.

Got it.
Thank you.