Logic Machine Forum
Modbus TCP/IP - 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: Modbus TCP/IP (/showthread.php?tid=1185)



Modbus TCP/IP - AndersH - 22.01.2018

Hi, first time to set up a communication Modbus TCP/IP in a HomeLynk.
KNX precens detectors should send a 1bit (1/0) to the ventilation system via Modbus, how should i start ?
Ventilation system is Modbus slave, and have IP 172.xx.xx.xxx, ID 240, and port 502

This is a script from ventilation system: 

  //mbreg[10001] = 0
//end
//Gate 1 slinga 1

addrange
g1 11101 11119
remnode
g1 11107
//Gate 1 slinga 2

addrange
g2 12107 12129
remrange
g2 12108 12119
//Gate 2 slinga 1

addrange
g3 21101 21127
remnode
g3 22114
//Gate 2 slinga 2

addrange
g4 22128 22141
remnode
g4 22133
//Gate 3 slinga 1
//addrange g5 31101 31116
//Gate 3 slinga 2
//addrange g6 32108 32109
//Gate 4 slinga 1

//Gate 4 slinga 2



foreach
n g1
  GMR = n -
1100

 
if mbreg[GMR] equal 1
   
tassign rep["Nrvarozon" @ n] 71
 
end
 
  
if mbreg[GMR] equal 0
   
restore rep["Nrvarozon" @ n]

 
end
next

foreach
n g2
  GMR = n -
2100

 
if mbreg[GMR] equal 1
   
tassign rep["Nrvarozon" @ n] 71
 
end
 
  
if mbreg[GMR] equal 0
   
restore rep["Nrvarozon" @ n]
 
end
 

next



foreach
n g3
  GMR = n -
10900

 
if mbreg[GMR] equal 1
   
tassign rep["Nrvarozon" @ n] 71
 
end
 
  
if mbreg[GMR] equal 0
   
restore rep["Nrvarozon" @ n]
 
end
 

next

foreach
n g4
  GMR = n -
11900

 
if mbreg[GMR] equal 1
   
tassign rep["Nrvarozon" @ n] 71
 
end


RE: Modbus TCP/IP - Daniel - 22.01.2018

Hi
There is not enough info here. At last this script is not telling me anything. To which registry do you want to write and via what modbus function?
BR


RE: Modbus TCP/IP - AndersH - 22.01.2018

If there is no info in the script file from the Ventilation guy leave it...
What information do i have to know ?


RE: Modbus TCP/IP - Daniel - 22.01.2018

Hi
Yes we can create profile and you have info on IP, ID(slave) and port
To create profile we need to know registry address and which modbus function to use.
BR


RE: Modbus TCP/IP - AndersH - 07.02.2018

I solved the problem Smile

Used the Modbus profile description and made a profile with the adresses (registers) that ventilation system used ....
imported the profile to HL and added new devise with the profile, after that was only to connect the KNX groupadresses to wright register...

File looks like this (but have about 100 registers):
  
{
"manufacturer": "Lindinvent",
"description": "Lindintell",
"mapping": [
{
"name": "1065 Driftpers",
"bus_datatype": "bool",
"datatype": "int16",
"type": "register",
"address": 10001,
"writable": 1
},
{
"name": "1067 Tvätt",
"bus_datatype": "bool",
"datatype": "int16",
"type": "register",
"address": 10002,
"writable": 1
   }
  ]
}