![]() |
Modbus RTU and File Descriptor Support for Parallel Interface Monitorin - 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 RTU and File Descriptor Support for Parallel Interface Monitorin (/showthread.php?tid=5853) |
Modbus RTU and File Descriptor Support for Parallel Interface Monitorin - Blooddah - 21.01.2025 Hello, I am currently working with the LuaModbus library to communicate with Modbus RTU devices and have successfully implemented basic register reading functionality. Below is a simplified example of my current approach. Code: require('luamodbus') Specifically, I am interested in achieving behavior similar to MQTT, where I can use "socket" to monitor multiple file descriptors and trigger events when data is available. Is it possible to retrieve a file descriptor for a Modbus RTU connection (similar to the MQTT socket), which I can integrate into an event loop? Code: --[[...]] -- Client initialization Any guidance or advice on how to implement this functionality with LuaModbus would be greatly appreciated. RE: Modbus RTU and File Descriptor Support for Parallel Interface Monitorin - admin - 21.01.2025 Not possible. Modbus library functions are blocking. You can't perform any other actions until read/write is finished. The only solution I see is to split each Modbus port handler into a different process. |