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.

write to modbus with bitmask
#8
(11.02.2022, 08:03)admin Wrote: You need to add write_only and write_multiple fields. Also you can simply map it a boolean object. Setting it to true will reset the error state.
Code:
{
  "name": "reset flow error (err 20)",
  "bus_datatype": "bool",
  "datatype": "int16",
  "type": "register",
  "address": 33471,
  "writable": true,
  "write_only": true,
  "write_multiple": true,
  "value_bitmask": 4
}

Poll interval only affects reading. Writing is done as soon as possible.

As I've said before using scripts together with profile will lead to random errors. If you need scripts then you should use mbproxy instead of accessing the port directly. Examples: https://forum.logicmachine.net/showthrea...7#pid22637
I works with this in de modbus profile:
{
      "name": "reset flow error (err 20)",
      "bus_datatype": "int16",
      "datatype": "int16",
      "type": "register",
      "address": 33471,
      "writable": true,
      "write_only": true,
      "write_multiple": true,
      "write_bitmask": true,
      "value_bitmask": 0x4
    }

Thanks for the help
Reply


Messages In This Thread
RE: write to modbus with bitmask - by admin - 09.02.2022, 07:52
RE: write to modbus with bitmask - by admin - 10.02.2022, 08:25
RE: write to modbus with bitmask - by admin - 11.02.2022, 08:03
RE: write to modbus with bitmask - by jeroen@stevens.biz - 19.02.2022, 14:02

Forum Jump: