This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Modbus tcp-ip problem
#1
Hi there,
I am trying to integrate a PLC modbus with homelynk. I have imported the profile file as follow:

{
"manufacturer":"VRA",
"description":"Demo",
"mapping":[
{"name":"Valvola","bus_datatype":"1","datatype":"bool","type":"coil","address":8970,"writable":false},
{"name":"Valvola","bus_datatype":"1","datatype":"bool","type":"coil","address":8969,"writable":false},
{"name":"Valvola","bus_datatype":"1","datatype":"bool","type":"coil","address":8971,"writable":false},
{"name":"Boost","bus_datatype":"1","datatype":"bool","type":"coil","address":9,"writable":true},
{"name":"Temp ambiente modbus","bus_datatype":"9","datatype":"int16","type":"register","address":8961,"value_multiplier":0.1,"writable":"false"},
{"name":"Temperatura Air Fresh","bus_datatype":"9","datatype":"int16","type":"register","address":8988,"value_multiplier":0.1,"writable":"true"},
{"name":"Temperatura Air Return","bus_datatype":"9","datatype":"int16","type":"register","address":16391,"value_multiplier":10,"writable":"true"},
{"name":"Temperatura Air Return","bus_datatype":"9","datatype":"int16","type":"register","address":16391,"value_multiplier":0.1,"writable":"false"},
{"name":"Temperatura Air Supply","bus_datatype":"9","datatype":"int16","type":"register","address":531,"writable":"false"},
{"name":"Velocità","bus_datatype":"8","datatype":"uint16","type":"register","address":779,"writable":"true"},
{"name":"Temperatura Air Exhaust","bus_datatype":"9","datatype":"int16","type":"register","address":532,"writable":"false"}
]
}

Communication is ok, temperature information is ok but I do not the reason why I cannot communicate with address 8970, 8969 and 8971.


What do you think? 
Thanks.
Reply
#2
Try removing datatype field for coils, also keep in mind that your coils are read-only because of writable setting
Reply
#3
Hi,
I think the problem is that those addresses are simple registers and not coil, try it!
Remember that the value of the field "writable" is used without simbols "", like this: "writable": true

Are you programming the PLC? If so can I know the model? So we can help you more Wink
Reply
#4
I am using a Eliwell. Do you know it?

There is another strange think. As you can see I use 2 variable of the same register (16391). One only readable and the others writeable. For one I used value multiplier 0.1 and the other multiplier is 10. Because PLC use 200 for 20 degress. Hence when I sent by HL the value is multiplied of 10 but when plc send its data (in this case is a temperature setpoint) . Everything works fine but sometimes it seems that values is multiplied by 0.1 instead 10 and viceversa the others. What do.you thibk about that?
Thanks.
Reply
#5
Multiplier is applied in reverse during write.

Read value conversion:
Code:
value = value_base + value * value_multiplier

Write value conversion:
Code:
value = (value - value_base) / value_multiplier
Reply
#6
So do you suggest to make a script instead use only modbus profile?
Thanks.
Reply
#7
What I'm saying is that value_multiplier will produce correct values for both read and write, because value conversion is applied in reverse for writing. Also, like Mirco said, writable field must be a boolean, if you set it to "false" it will actually become true because it is a string.
Reply
#8
Last month I have used an Eliwell too, so I am almost sure that registers from 8000 are registers and not coil.
As admin say, you don't have to use 2 variables to read and write a register. I'll try to explain with an example:

{"name": "Temperatura Air Return", "bus_datatype": "9", "datatype": "int16", "type": "register", "address": 16391, "value_multiplier": 0.1, "writable": true},

if in your register 16391 there's the value 200°C, with the thet code you read 20,0°C and when you try to write, for example 30,5°C, in your PLC the homelynk will write 305°C.

Hope I was helpful Wink
Reply
#9
Thank you mate.
I am agreed with you but it seems that when I wrote to PLC 30,5 °C PLC received 30,5 and not 305. This is the reason why I add the same variable with 2 different writable.
Unfortunately now I cannot test it and I will be back the next week on the plant.
Thanks.
Reply


Forum Jump: