Logic Machine Forum
I can't write on Modbus - 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: I can't write on Modbus (/showthread.php?tid=3633)



I can't write on Modbus - gdimaria - 20.10.2021

Hi, I am having issues with 2 different modbus devices, CALEFFI GATEWAY PRO and ALDES INSPINAIR.

I can read mapped registers, but I can write on them (the writeble ones, of course) from LM.

If I try to write with a diagnostic program such modbus doctor, I can do it.

Do you have any suggestions for me?

Thank you in advance

Peppe


RE: I can't write on Modbus - admin - 21.10.2021

Do you get anything in the Modbus Error log?


RE: I can't write on Modbus - gdimaria - 21.10.2021

(21.10.2021, 07:08)admin Wrote: Do you get anything in the Modbus Error log?

NO, no Modbus errors logged....   when I write in the virtual mapped object it seems like the device receive nothing.

For istance, if I set a temperature setpoint to 22, I can see 22 on LM for a while, but when the polling cicle is done, I get the old value again and on the modbus device nothing is actually changed.

Even, I can read everything from it.

It's like a unidirectional comm....


RE: I can't write on Modbus - admin - 22.10.2021

Can you provide access to this LM via ZeroTier?


RE: I can't write on Modbus - gdimaria - 22.10.2021

yes, it is on our ZeroTier network.


RE: I can't write on Modbus - admin - 22.10.2021

Then please send me the network ID, LM IP and admin password via PM. You'll probably have to accept my connection once I join the network unless you have set it to public (not recommended for security reasons).


RE: I can't write on Modbus - admin - 22.10.2021

Thanks for the access. Writing for CALEFFI GW PRO is working fine, I've tested by changing the setpoint. For ALDES INSPIRAIR you need to modify the profile and add these fields for all entries with writable set to true:
Code:
"datatype": "uint16",
"write_multiple": true



RE: I can't write on Modbus - gdimaria - 22.10.2021

(22.10.2021, 09:22)admin Wrote: Thanks for the access. Writing for CALEFFI GW PRO is working fine, I've tested by changing the setpoint. For ALDES INSPIRAIR you need to modify the profile and add these fields for all entries with writable set to true:
Code:
"datatype": "uint16",
"write_multiple": true

Ok, I 'll try it... thanks!

"write_multiple": true
I have to ADD it, not to substitute to "write": true
Is it correct?
Can you explain just to be aware for future issues?
Tnx


RE: I can't write on Modbus - admin - 22.10.2021

You have to add these fields, "writable": true must still be in the entry.
Code:
{
  "name": "Demande User",
  "bus_datatype": "uint16",
  "type": "register",
  "address": 257,
  "writable": true,
  "datatype": "uint16",
  "write_multiple": true,
  "value_custom": {
    "0": "holiday",
    "1": "daily",
    "2": "cooking",
    "3": "guest"
  }
}
Modbus has two different functions for writing single and multiple registers. Some devices support only the multiple write function. If write_multiple is enabled then LM will use multiple write function when writing to a single register.