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 - Writing with bitmask
#1
Hi,

I have several bits I have to write in some registers.

The reading is working fine with bitmask, but I don't want to read, just write.

When I write TRUE it always sets to "1" the first bit of the register, not the one selected in the bitmask.

Am I missing something ?


{"name":"Set Heat Mode"            ,"bus_datatype":"1","type":"register","datatype":"int16", "address":1057,    "value_bitmask":0x4,          "read_swap":"n",     "writable":1 },
{"name":"Set Cool Mode"            ,"bus_datatype":"1","type":"register","datatype":"int16", "address":1057,    "value_bitmask":0x8,          "read_swap":"n",     "writable":1 },
{"name":"Set Lock Mode"            ,"bus_datatype":"1","type":"register","datatype":"int16", "address":1057,    "value_bitmask":0x20,         "read_swap":"n",  "writable":1 },
{"name":"Set On Off"                  ,"bus_datatype":"1","type":"register","datatype":"int16", "address":1057,    "value_bitmask":0x80,         "read_swap":"n",  "writable":1 },
{"name":"Set Fan AUTO"             ,"bus_datatype":"1","type":"register","datatype":"int16", "address":1058,    "value_bitmask":0x80,         "read_swap":"n",     "writable":1 },
{"name":"Set Fan LOW"              ,"bus_datatype":"1","type":"register","datatype":"int16", "address":1058,    "value_bitmask":0x4,          "read_swap":"n",     "writable":1 },
{"name":"Set Fan MID"                ,"bus_datatype":"1","type":"register","datatype":"int16", "address":1058,    "value_bitmask":0x2,          "read_swap":"n",     "writable":1 },
{"name":"Set Fan HIGH"              ,"bus_datatype":"1","type":"register","datatype":"int16", "address":1058,    "value_bitmask":0x1,          "read_swap":"n",     "writable":1 },


Thank you
Reply


Messages In This Thread
Modbus - Writing with bitmask - by iJAF - 19.02.2019, 12:07
RE: Modbus - Writing with bitmask - by admin - 19.02.2019, 12:19
RE: Modbus - Writing with bitmask - by iJAF - 19.02.2019, 12:32
RE: Modbus - Writing with bitmask - by admin - 19.02.2019, 12:53
RE: Modbus - Writing with bitmask - by iJAF - 19.02.2019, 15:06
RE: Modbus - Writing with bitmask - by admin - 20.02.2019, 07:30

Forum Jump: