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 TCP Profile
#1
Hi, I need some help with a modbus profile to read some registers on a slave.
The slave has a register on the holding area which is an array of bool, I've been able to read it an map to bool KNX addresses.
What I'm not able to do is to write bit to bit from logic machine, when I write a value 1 to one bit, it applies the mask and all the other from the modbus register turns to 0.
Here is the part of the profile I've created for two bits from the holding register:

{"name": "Array_Bool_[0]",
    "bus_datatype": "bool",
    "bus_address": "32/1/7",
    "type": "register",
    "address": 4,
    "value_bitmask": 0x01,
    "writable": 1,
    "read_swap": 1
},
{"name": "Array_Bool_[1]",
    "bus_datatype": "bool",
    "bus_address": "32/1/8",
    "type": "register",
    "address": 4,
    "value_bitmask": 0x02,
    "writable": 1,
    "read_swap": 1
}

I'm nut sure if i'm using "read_swap" correctly because i can't see any difference using it or not....

Is there any way to solve it?
Thanks!
Reply
#2
For now bitfields are only supported for reading. You have to create a script which assembles each bit into a final register value if you need write operation.

Setting swap to "true" does not change anything for a single register. It does "word" swap which only make a difference for several registers.
Reply
#3
(26.06.2017, 07:45)admin Wrote: For now bitfields are only supported for reading. You have to create a script which assembles each bit into a final register value if you need write operation.

Setting swap to "true" does not change anything for a single register. It does "word" swap which only make a difference for several registers.

Ok, thanks!
Reply


Forum Jump: