(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,
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') if not mb then mb = luamodbus.tcp() mb:open('192.168.201.53') mb:connect() end mb:setdebug(true) openvalue = grp.getvalue('6/3/1') tfvalue = mb:readinputregisters(54) ffvalue = mb:readinputregisters(55) mb:close() if tfvalue > ffvalue then if openvalue < 220 then openvalue = openvalue + 25 end end if ffvalue < ffvalue then if openvalue > 25 then openvalue = openvalue - 25 end end grp.write('6/3/1', openvalue)
I would be very grateful if you can help me with this problem
/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.