Logic Machine Forum
Modbus timeout and Write Problem - 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 timeout and Write Problem (/showthread.php?tid=4860)



Modbus timeout and Write Problem - savaskorkmaz - 05.07.2023

Hi ,
We have modbus device that we can read and write each indivual register via modbus poll. Also we can read all these register if we create a profile file includes only 1 register. But if we make a profile includes 5 register instead of 1 register , we have timeout problem and modbus communication turns red. 

We tried 2 different profile files.

Profile 1 and test results :
With this profile file , at the beginning we read 2552, 2554 , 2566 . After 3 seconds, timeout error, modbus turns red and no read anymore.

  "manufacturer": "Gree Klima",
  "description": "Gree Klima Modbus",
  "mapping": [
{"address": 2552, "name": "Klima On-Off-99", "datatype": "uint16", "bus_datatype": "uint8", "type": "register",  "writable": true},
{"address": 2553, "name": "Operation Mode-99", "datatype": "uint16", "bus_datatype": "uint8", "type": "register",  "writable": true},
{"address": 2554, "name": "Setpoint-99", "datatype": "uint16", "bus_datatype": "uint16", "type": "register",  "writable": true, "value_multiplier": 0.1},
{"address": 2555, "name": "Fan Speed-99", "datatype": "uint16", "bus_datatype": "uint8", "type": "register",  "writable": true},
{"address": 2566, "name": "IAT-99", "datatype": "uint16", "bus_datatype": "uint16", "type": "register", "value_multiplier": 0.1}
  ]


Profile 2 and test results :
With this profile file , at the beginning we can read all registers . After 3 seconds, timeout error, modbus turns red and no read anymore.

  "manufacturer": "Gree Klima",
  "description": "Gree Klima Modbus",
  "mapping": [
{ "address": 2552, "read_count":4, "read_offset":0, "read_delay":0.1, "name": "Klima On-Off-99", "datatype": "uint16", "bus_datatype": "uint8", "type": "register", "writable": true },
{ "address": 2552, "read_count":4, "read_offset":1, "read_delay":0.1, "name": "Operation Mode-99", "datatype": "uint16", "bus_datatype": "uint8", "type": "register", "writable": true },
{ "address": 2552, "read_count":4, "read_offset":2, "read_delay":0.1, "name": "Setpoint-99", "datatype": "uint16", "bus_datatype": "uint16", "type": "register", "writable": true },
{ "address": 2552, "read_count":4, "read_offset":3, "read_delay":0.1, "name": "Fan Speed-99", "datatype": "uint16", "bus_datatype": "uint8", "type": "register", "writable": true },
{ "address": 2566, "name": "IAT-99", "datatype": "uint16", "bus_datatype": "uint16", "type": "register", "value_multiplier": 0.1}
  ]


Problem 2 : 

We cannot write any of this register. If we put only 1 register ( For example set point ) in to profile, there is no timeout problem and there is no read problem. But we cannot write the value to modbus.

Need advices.

Regards


RE: Modbus timeout and Write Problem - admin - 05.07.2023

read_delay is a global profile setting like manufacturer and description: https://forum.logicmachine.net/showthread.php?tid=903&pid=13343#pid13343


RE: Modbus timeout and Write Problem - rw_echo - 19.07.2023

Admin, I have a similar issue where my modbusprofile file cannot read any data, even if I add 'read'_ Delay '', but still without any help, What other methods can I try to solve the problem of data not being read?
Here is my profile:
---------------------
{
"manufacturer": "Embedded Systems_FAN",
"timeout": 3,
"read_delay": 1,
"description": "CSJC",
"mapping": [
{ "name": "Zeroing","bus_datatype": "uint16","type": "register", "writable": 1, "write_only": true,"address": 0x04 },
{ "name": "Voltage","bus_datatype": "float16","type": "register", "address": 0x07, "value_multiplier": 0.01,"units": "V"},
{ "name": "Voltage","bus_datatype": "float16","type": "register", "address": 0x08, "value_multiplier": 0.01,"units": "V"},
{ "name": "Current","bus_datatype": "float16","type": "register", "address": 0x09, "value_multiplier": 0.01,"units": "A" },
{ "name": "Current","bus_datatype": "float16","type": "register", "address": 0x0A, "value_multiplier": 0.01,"units": "A" },
{ "name": "Current","bus_datatype": "float16","type": "register", "address": 0x0B, "value_multiplier": 0.01,"units": "A" },
{ "name": "Current","bus_datatype": "float16","type": "register", "address": 0x0C, "value_multiplier": 0.01,"units": "A" },
{ "name": "Current","bus_datatype": "float16","type": "register", "address": 0x0D, "value_multiplier": 0.01,"units": "A" },
{ "name": "Current","bus_datatype": "float16","type": "register", "address": 0x0E, "value_multiplier": 0.01,"units": "A" },
{ "name": "Apparent power","bus_datatype": "float16","type": "register", "address": 0x19, "value_multiplier": 0.001,"units": "KVA"},
{ "name": "Apparent power","bus_datatype": "float16","type": "register", "address": 0x1A, "value_multiplier": 0.001,"units": "KVA"},
{ "name": "Apparent power","bus_datatype": "float16","type": "register", "address": 0x1B, "value_multiplier": 0.001,"units": "KVA" },
{ "name": "Apparent power","bus_datatype": "float16","type": "register", "address": 0x1C, "value_multiplier": 0.001,"units": "KVA" },
{ "name": "Apparent power","bus_datatype": "float16","type": "register", "address": 0x1D, "value_multiplier": 0.001,"units": "KVA" },
{ "name": "Power factor","bus_datatype": "float16","type": "register", "address": 0x1E, "value_multiplier": 0.001 },
{ "name": "Power factor","bus_datatype": "float16","type": "register", "address": 0x1F, "value_multiplier": 0.001 },
{ "name": "Power factor","bus_datatype": "float16","type": "register", "address": 0x20, "value_multiplier": 0.001 },
{ "name": "Power factor","bus_datatype": "float16","type": "register", "address": 0x21, "value_multiplier": 0.001 },
{ "name": "Power factor", "bus_datatype": "float16","type": "register", "address": 0x22, "value_multiplier": 0.001 },
{ "name": "Frequency","bus_datatype": "float16", "type": "register","address": 0x23, "value_multiplier": 0.01,"units": "HZ" },
{"name": "Electric energy","bus_datatype": "float32","type": "register","address": 0x38,"read_swap":"w","datatype": "uint32", "value_multiplier": 0.01,"units": "KWh"},
{"name": "Electric energy","bus_datatype": "float32","type": "register","address": 0x3A,"read_swap":"w","datatype": "uint32", "value_multiplier": 0.01,"units": "KWh"},
{"name": "Electric energy","bus_datatype": "float32","type": "register","address": 0x3C,"read_swap":"w","datatype": "uint32", "value_multiplier": 0.01,"units": "KWh"},
{"name": "Electric energy","bus_datatype": "float32","type": "register","address": 0x3E,"read_swap":"w","datatype": "uint32", "value_multiplier": 0.01,"units": "KWh"},
{"name": "Electric energy","bus_datatype": "float32","type": "register","address": 0x40,"read_swap":"w","datatype": "uint32", "value_multiplier": 0.01,"units": "KWh"}
]
}


RE: Modbus timeout and Write Problem - Daniel - 19.07.2023

Does the Read test work for you?


RE: Modbus timeout and Write Problem - rw_echo - 20.07.2023

Read test is working normally


RE: Modbus timeout and Write Problem - Daniel - 20.07.2023

What error do you get in modbus logs when it doesn't work. Make sure GND is also connected.


RE: Modbus timeout and Write Problem - rw_echo - 20.07.2023

The device is 485 communication, not 232.


RE: Modbus timeout and Write Problem - admin - 20.07.2023

GND is highly recommended for RS485 as well. Usually connecting GND solves communication problems.


RE: Modbus timeout and Write Problem - rw_echo - 21.07.2023

The slave device does not have GND, is it connecting LM's B with GND?


RE: Modbus timeout and Write Problem - admin - 21.07.2023

Can you provide documentation for your device? Sometimes the GND connection is called 0V. If your device is powered via DC you can connect GND to power supply input negative pole.


RE: Modbus timeout and Write Problem - rw_echo - 21.07.2023

The device documentation is all in Chinese, and the device is powered by 220V AC voltage. Its 485 interface only has A and B.


RE: Modbus timeout and Write Problem - admin - 24.07.2023

Check that LM power supply and Modbus device are connected to the same AC L / N lines. Check that L / N are not swapped on either LM power supply or Modbus device. Another thing to try is 120 Ohm termination resistor on the Modbus device side.