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
#1
I have a problem writing to a GREE brand air conditioning machine.
From a PAS600 TCP/IP modbus gateway and software I can do the writing in Word 2 for the ON/OFF and setpoint change, but from the Logic Machine I have not been able to.

This is the json file.

{
  "manufacturer": "LM",
  "description": "Special Profile",
  "mapping": [
{ "name": "ON_OFF", "bus_datatype": "int16", "type": "register", "address": 2, "writable": true },
{ "name": "Ambient temperature", "bus_datatype": "int16", "type": "register", "address":4, "writable":false, "value_multiplier": 0.1, "units": "° C"},
{ "name": "mode", "bus_datatype": "uint16","type":"register", "address":17, "writable":true },
{ "name": "set fan speed", "bus_datatype": "uint16", "type": "register", "address":19, "writable":true },
{ "name": "set point", "bus_datatype": "uint16", "type": "register", "address": 20, "writable": true },
{ "name": "set point1", "bus_datatype": "int16", "type": "register", "address": 20, "writable": true },
{ "name": "Operation", "bus_datatype": "uint16", "type": "register", "address": 20, "writable": true},
{ "name": "Operation Mode ", "bus_datatype": "uint16", "datatype": "uint16", "type": "register", "address": 20, "writable": true}
  ]

  }
I have tried all possible options, but nothing.
How can I know the command that is being output via modbus TCP/IP to the PAS600 gateway?

Attached Files
.pdf   Acrobat Document_UM_R32.pdf (Size: 831.25 KB / Downloads: 12)
.json   GREE_3.json (Size: 655 bytes / Downloads: 9)
Reply
#2
Add "write_multiple" : true
------------------------------
Ctrl+F5
Reply
#3
(16.01.2024, 08:54)Daniel Wrote: Add "write_multiple" : true
Sorry, I also tried this yesterday but the same thing keeps happening to me.


{
  "manufacturer": "LM",
  "description": "Special Profile",
  "mapping": [
{ "name": "ON_OFF", "bus_datatype": "int16", "type": "register", "address": 2, "writable": true ,  "write_multiple": true},
{ "name": "Temperatura ambiente", "bus_datatype": "int16", "type": "register",  "address":4, "writable":false, "value_multiplier": 0.1, "units": "°C"},
{ "name": "mode", "bus_datatype": "uint16","type":"register", "address":17, "writable":true,  "write_multiple": true },
{ "name": "set fan speed",  "bus_datatype": "uint16", "type": "register",  "address":19, "writable":true,  "write_multiple": true },
{ "name": "set point", "bus_datatype": "uint16", "type": "register", "address": 20, "writable": true,  "write_multiple": true },
  ]

}
Reply
#4
Which value did you try sending? According to docs you need to send 170 (0xAA) to turn it ON and 85 (0x55) to turn it OFF.
See if you can read register values using read test.
Reply
#5
Hello, that's right, I read the values perfectly. The problem is when writing. With the readtest I see the values, both 170 (0xAA) and 85 (0x55).
In fact, I have done the writing through a program that I have and I can turn the machine on and off, but not from the LM.
Reply
#6
Add "datatype": "uint16"
------------------------------
Ctrl+F5
Reply
#7
Hello, 
I also tried with uint16 but it doesn't work, I have tried everything.


Now, I just tried it this way and it works with this script.


-- object mapped to this event must have its data type set
value = event.getvalue()

require('luamodbus')
mb3 = luamodbus.tcp()
IP='192.168.1.141'  --IP

mb3:open(IP, 502)
mb3:connect()

address=1 ----DIRECCIÓN DEL DISPOSITIVO ESCLAVO
mb3Confusedetslave(address)

registro=2 --registro modbus

--valueInt1, valueInt2 = mb3:readregisters(registro,1)

--log(valueInt1, valueInt2 )

r1, r2 = mb3:writemultipleregisters(registro, value)

Do you know any way to be able to see the modbus command that comes out through the port, that is, the composition of the writing, to see what it sends through the port?
Reply


Forum Jump: