Logic Machine Forum
Modus Profile write multiple coils - 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: Modus Profile write multiple coils (/showthread.php?tid=3941)



Modus Profile write multiple coils - gtsamis - 21.03.2022

Hi,

I have a Astra Pool heat pump and i would like some help on the profile.
Can i write multiple coils via the profile? What datatatype should i use on the object? e.g. coils 0x211 & 0x212
   

Thanks in advance


RE: Modus Profile write multiple coils - admin - 21.03.2022

Using multiple coils like this is not supported. You can use register with bitmask instead.


RE: Modus Profile write multiple coils - gtsamis - 21.03.2022

(21.03.2022, 12:27)admin Wrote: Using multiple coils like this is not supported. You can use register with bitmask instead.

Would that work?


{ "name": "Heat Pump Mode bit1", "address": 33, "bus_datatype": "bool",  "datatype":"uint16", "type": "register", "value_bitmask":0x2, "write_bitmask": true, "writable":true},
{ "name": "Heat Pump Mode bit2", "address": 33, "bus_datatype": "bool",  "datatype":"uint16", "type": "register", "value_bitmask":0x4, "write_bitmask": true, "writable":true},

{ "name": "Heat Pump Control", "address": 33, "bus_datatype": "bool",  "datatype":"uint16", "type": "register", "value_bitmask":0x100, "write_bitmask": true, "writable":true},

{ "name": "Heat Pump Inverter Mode bit1", "address": 33, "bus_datatype": "bool",  "datatype":"uint16", "type": "register", "value_bitmask":0x200, "write_bitmask": true, "writable":true},
{ "name": "Heat Pump Inverter Mode bit2", "address": 33, "bus_datatype": "bool",  "datatype":"uint16", "type": "register", "value_bitmask":0x400, "write_bitmask": true, "writable":true},


RE: Modus Profile write multiple coils - admin - 21.03.2022

It will work but you would still have separate control and status for all bits.

Use this instead. 2-bit values will be mapped to 1-byte objects where you can define custom values for the 0..3 range.
Code:
{ "name": "Heat Pump Mode", "address": 33, "bus_datatype": "uint8", "datatype": "uint16", "type": "register", "value_bitmask": 0x6, "write_bitmask": true, "writable": true },

{ "name": "Heat Pump Control", "address": 33, "bus_datatype": "bool", "datatype": "uint16", "type": "register", "value_bitmask": 0x100, "write_bitmask": true, "writable": true },

{ "name": "Heat Pump Inverter Mode", "address": 33, "bus_datatype": "uint8", "datatype": "uint16", "type": "register", "value_bitmask": 0x600, "write_bitmask": true, "writable": true },



RE: Modus Profile write multiple coils - gtsamis - 21.03.2022

(21.03.2022, 13:53)admin Wrote: It will work but you would still have separate control and status for all bits.

Use this instead. 2-bit values will be mapped to 1-byte objects where you can define custom values for the 0..3 range.
Code:
{ "name": "Heat Pump Mode", "address": 33, "bus_datatype": "uint8", "datatype": "uint16", "type": "register", "value_bitmask": 0x6, "write_bitmask": true, "writable": true },

{ "name": "Heat Pump Control", "address": 33, "bus_datatype": "bool", "datatype": "uint16", "type": "register", "value_bitmask": 0x100, "write_bitmask": true, "writable": true },

{ "name": "Heat Pump Inverter Mode", "address": 33, "bus_datatype": "uint8", "datatype": "uint16", "type": "register", "value_bitmask": 0x600, "write_bitmask": true, "writable": true },

Thank you