Logic Machine Forum
modbus Profiles - 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 Profiles (/showthread.php?tid=4675)



modbus Profiles - rw_echo - 24.03.2023

I want to use the modbus configuration file on the LM to control the 485 slave device

"My requirement is that the mapped switch address' 1/1/1 'implements a write command to register 23. When the switch  value is true, write 0xAAAA to address 23, and when the switch value is false, write 0x5555 to address 23.".

How should I change the ". json" file below to meet my requirements (without writing a script to implement it).
Code:
...

{ "name": "on_off",          "bus_datatype": "bool",     "type": "register", "writable": 1,   "address": 23, "value_custom":  { "0": "off","1": "on" } },

...



RE: modbus Profiles - admin - 24.03.2023

Not possible without a script.


RE: modbus Profiles - rw_echo - 24.03.2023

Can the '. json' file implement bit writing to registers, such as writing values of 1 or 0 to bit3, bit4b, and bit7 without changing the values of the remaining bits.


RE: modbus Profiles - admin - 24.03.2023

Yes, see value_bitmask and write_bitmask mapping fields: https://openrb.com/docs/modbus.htm