AHU MODBUS TCP VALUE - 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: AHU MODBUS TCP VALUE (/showthread.php?tid=1687) |
AHU MODBUS TCP VALUE - Elmyran - 01.11.2018 Hi, I try to connect to Schneider-electric Homelynx and get the airflow from an IVP AHU ventilation unit with a climactix controller. I need to compare two values in order to control a mixing valve. The valve opens and closes until the two values are as equal as possible. The value is to be retrieved from a Holding register with the address 4x0055 and 4x0056. But unfortunately I do not get any values, it seems that it does not connect or I have typed the wrong code to get the air value correctly. Code: require('luamodbus') I would be very grateful if you can help me with this problem /Tommy RE: AHU MODBUS TCP VALUE - Erwin van der Zwart - 01.11.2018 Hi, First of all you have not set a port on the Modbus TCP connection: Code: mb:open('192.168.201.53', 502) Code: tfvalue, ffvalue = mb:readregisters(55, 2) BR, Erwin RE: AHU MODBUS TCP VALUE - CHOUAIBOU - 01.11.2018 (01.11.2018, 19:42)Elmyran Wrote: Hi, I try to connect to Schneider-electric Homelynx and get the airflow from an IVP AHU ventilation unit with a climactix controller.Hi Tommy, To establish modbus TCP connection between modbus master and modbus slave, you need to specify the port and the slave Id. B.R, Chouaibou. RE: AHU MODBUS TCP VALUE - Erwin van der Zwart - 01.11.2018 Hi, Not 100% sure but i believe slave id is optional by TCP device (without it the default is used). BR, Erwin RE: AHU MODBUS TCP VALUE - admin - 02.11.2018 Is it a resident or a scheduled script? If it's resident then it will only work once because you are closing the connection via mb:close(). Setting slave id for TCP is optional by standard (255 is used when not set) but some devices might require it. Start by logging each step return results: Code: require('luamodbus') RE: AHU MODBUS TCP VALUE [solved] - Elmyran - 02.11.2018 Thanks for your help, I got the script to work today. When I contacted AHU, I realized that it was the wrong values I received. There were inputs 95 and 96 that I needed to compare. Here is the final working code: Code: require('luamodbus') it was as simple as that. |