Logic Machine Forum
Modbus TCP Profile - 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 TCP Profile (/showthread.php?tid=868)



Modbus TCP Profile - jmir - 26.06.2017

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!


RE: Modbus TCP Profile - admin - 26.06.2017

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.


RE: Modbus TCP Profile - jmir - 26.06.2017

(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!