Modbus Question - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: Modbus Question (/showthread.php?tid=5490) |
Modbus Question - gtsamis - 29.06.2024 Hi all, Can someone please advice on how to write setpoint like the example below: Function code:16 Register Address: 45004 Data Length: 2bytes VRF unit - set temperature: bit0-bit6: 1–100 indicate 1–100°C / bit7: flag of half a degree (1 - Existence of 0.5°C, 0 - No 0.5°C) Thank you in advance George RE: Modbus Question - Erwin van der Zwart - 29.06.2024 Just write your value setpoint value to the register like 20, 22, 24 etc and if you want 20.5 you need to add 128 to the value (sets bit 7) so 20,5 = 20 + 128 = 148 to the register You could create a small script to automate your calculation. RE: Modbus Question - gtsamis - 29.06.2024 (29.06.2024, 10:58)Erwin van der Zwart Wrote: Just write your value setpoint value to the register like 20, 22, 24 etc and if you want 20.5 you need to add 128 to the value (sets bit 7) so 20,5 = 20 + 128 = 148 to the register Thank you RE: Modbus Question - Osvaldas - 04.07.2024 Hi there, I'm having some trouble enabling "active cooling" on my Iglu heat pump using Modbus. I've spent several hours trying to send commands through Modbus, but haven't been successful. I should send 1 to 7th bit in the register 4005. Here's the configuration I've been using: { "bus_address": "41/1/3", "name": "Active Cooling enable", "bus_datatype": "int16", "datatype": "int16", "type": "register", "writable": true, "write_multiple": true, "address": 4005 } I've also attempted using a bitmask configuration: { "bus_address": "41/1/3", "name": "Active Cooling enable", "bus_datatype": "int16", "datatype": "int16", "type": "register", "writable": true, "write_multiple": true, "write_bitmask": true, "value_bitmask": 128, "address": 4005 } However, neither approach has worked. I'm able to successfully send data to other registers that don't require a bitmask. Is there anything I might be missing in my configuration? RE: Modbus Question - admin - 04.07.2024 Can you read this register value using read test? When using bitmask for a single bit in a register you can set bus_datatype to "bool". RE: Modbus Question - Osvaldas - 04.07.2024 (04.07.2024, 07:29)admin Wrote: Can you read this register value using read test? When using bitmask for a single bit in a register you can set bus_datatype to "bool". Yes, I can read this register value. I also can change the mode of the heat pump through the Iglu app and get feedback into the LM address "41/1/3." However, if I try to set the same numbers I see when I activate active cooling through the app, it doesn't work. In the LM, I see that the value in the address "41/1/3" is 128 when active cooling is activated and 16 when active cooling is off. When I try to set values in the address "41/1/3" I still cannot control the mode directly. Ok I will change bus type to bool RE: Modbus Question - admin - 04.07.2024 Do you have any errors in the Modbus error log? RE: Modbus Question - Osvaldas - 04.07.2024 (04.07.2024, 08:41)admin Wrote: Do you have any errors in the Modbus error log? No I don't have any Modbus errors. Maybe there's a mistake in data types. Now, when I read the register address, I get a response of 400 when active cooling is enabled and 272 when cooling is off. But anyway, I tried sending 400, and active cooling mode doesn't activate. Right now, the profile for this address looks like this: { "bus_address": "41/1/3", "name": "Active Cooling enable", "bus_datatype": "int16", "datatype": "int16", "type": "register", "writable": true, "write_multiple": true, "address": 4005 }, I have removed the bitmask value because I wanted to see the value when I change the mode through the app. RE: Modbus Question - Daniel - 04.07.2024 Drop documentation of this device RE: Modbus Question - Osvaldas - 04.07.2024 (04.07.2024, 10:09)Daniel Wrote: Drop documentation of this device Unfortunately, the only documentation I have available is a list of registers. RE: Modbus Question - Daniel - 04.07.2024 Try removing write_multiple. RE: Modbus Question - Osvaldas - 04.07.2024 (04.07.2024, 10:29)Daniel Wrote: Try removing write_multiple. Finally it worked. Thank you! |