Logic Machine Forum
Send KNX commands to control AHU Controller over MODBUS RTU - 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: Send KNX commands to control AHU Controller over MODBUS RTU (/showthread.php?tid=3798)



Send KNX commands to control AHU Controller over MODBUS RTU - Sumit - 07.01.2022

Hi,

We are trying to send commands to Loytec/Delta AHU controller via KNX object for setting temperature over MODBUS RTU. 
We need help regarding the scripting for the same.

1. Need 2 data points from logic machine that is "Set temprature" & "Actual temperature" in MODBUS RTU.

2. For these datapoint we need the register address of the same (mapping details).

This values should be communicated in MODBUS so that we can send KNX commands to loytec controller and based on this datapoint the VFD & modulating valve will be controlled.


RE: Send KNX commands to control AHU Controller over MODBUS RTU - Daniel - 07.01.2022

You need to create modbus profile for your modbus controller. We can help you but you need to provide registry documentation first.


RE: Send KNX commands to control AHU Controller over MODBUS RTU - Sumit - 07.01.2022

(07.01.2022, 08:41)Daniel Wrote: You need to create modbus profile for your modbus controller. We can help you but you need to provide registry documentation first.
Dear sir,

PFA of the sample file where device will provide the mapping details to program.
same wise this mapping deatils the device Logic macine need to be provided with which we'll configure those resigter addresses in Loytec/delta software.


RE: Send KNX commands to control AHU Controller over MODBUS RTU - Daniel - 07.01.2022

Before we do anything first use Read test in LM to see if we starting to count from 1 or 0. Try Air!Temperature!Set!Point and read the value, you may need to subtract 1 from register.
Why do you have input and holding register for the same value? Do you want to read from one and write to another or can we read and write just to holding? Check what the manual says.


RE: Send KNX commands to control AHU Controller over MODBUS RTU - Sumit - 07.01.2022

(07.01.2022, 09:28)Daniel Wrote: Before we do anything first use Read test in LM to see if we starting to count from 1 or 0.  Try Air!Temperature!Set!Point  and read the value,  you may need to subtract 1 from register.
Why do you have input and holding register for the same value? Do you want to read from one and write to another or can we read and write just to holding?  Check what the manual say
Need input resgister for same values, read & write.


RE: Send KNX commands to control AHU Controller over MODBUS RTU - admin - 07.01.2022

The actual address for the setpoint can be either 23 or 22. Usually the leading number in the address specifies the function which is used (3 for input register, 4 for holding register).


RE: Send KNX commands to control AHU Controller over MODBUS RTU - Sumit - 07.01.2022

ok can you send me the script.


RE: Send KNX commands to control AHU Controller over MODBUS RTU - Daniel - 07.01.2022

There is no need for any script only profile. As I already mentioned earlier, first use Read test to see the correct registry address, post your result here.


RE: Send KNX commands to control AHU Controller over MODBUS RTU - Sumit - 07.01.2022

we're not taking any value to test. we are supposed to send KNX temp value to Modbus by Logic machine. once if we create & convert to modbus values they will scan & check the values for Logic machine device. 
Logic machine will be the device which should have the data that to send in MODBUS.
RTU test is where we can scan the register of other device & read those values, in our case we are suppose to give values our Logic macine device to other device over MODBUS.


RE: Send KNX commands to control AHU Controller over MODBUS RTU - admin - 07.01.2022

If you want LM to act as Modbus Slave then see this thread: https://forum.logicmachine.net/showthread.php?tid=181
The script is for TCP, scroll down for required changes for RTU mode. Modbus mapper must be disabled for the port that is used in this script.


RE: Send KNX commands to control AHU Controller over MODBUS RTU - Sumit - 12.01.2022

I need LM to be MODBUS RTU.
for those datapoints which we want is of Temperature sensor & data point register address should be given with mapping details for BMS vendor who is integrating.

They'll scan the datapoint of particular register address where it shows the values in MODSCAN, as shown in attachment .

we have connected rs485 -1 of LM to their BMS MODBUS port in controller. LM has to send the temperature value which is in KNX, convert & send them in MODBUS RTU, their BMS controller will be reading LM values

PFA of port which is connected


RE: Send KNX commands to control AHU Controller over MODBUS RTU - admin - 12.01.2022

Modbus mapping tab is when LM acts as a master device. It seems that you need slave. See my previous post, it links to Modbus slave script example.


RE: Send KNX commands to control AHU Controller over MODBUS RTU - Sumit - 13.01.2022

can you please elaborate or mention the places where i need to add the register number & they'll take data points in MODBUS TCP & LM will be slave as you said.
  
  mb = luamodbus.tcp()

  mb:open('0.0.0.0', 502) - here do i need to mention LM IP in the script


RE: Send KNX commands to control AHU Controller over MODBUS RTU - admin - 13.01.2022

Try running the example as is, just change the group address list as needed. You don't have to change the IP, leave it as 0.0.0.0


RE: Send KNX commands to control AHU Controller over MODBUS RTU - Sumit - 17.01.2022

i have doubt, do i need to enable modbus tcp in LM, & what will be slave ID, starting register and data type?


RE: Send KNX commands to control AHU Controller over MODBUS RTU - admin - 17.01.2022

You don't have to enable anything. Modbus slave is done via a script from here: https://forum.logicmachine.net/showthread.php?tid=181