Reading 8 coil points as a 1 byte in Modbus - 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: Reading 8 coil points as a 1 byte in Modbus (/showthread.php?tid=3766) |
Reading 8 coil points as a 1 byte in Modbus - savaskorkmaz - 22.12.2021 Hello, We are trying to Communicate with a Toshiba VRV device. Point List is attached as a picture in this thread. We were able to communicate with all points except Fan Speed and Operation Mode those are marked red in the attached picture. You can find our Profile below. We did it everything. We tried to communicate bit to bit and tried to merge in Logic Machine also. What do you suggest to communicate Fan Speed and Operation Mode points ? How we can change our profile file shown below ? Regards, { "manufacturer": "Toshiba VRV", "description": "Toshiba VRV", "mapping": [ { "address": 0, "name": "VRV 1 ON OFF", "bus_datatype": "bool", "type": "coil", "writable":1}, { "address": 8, "name": "VRV 1 Mod", "bus_datatype": "uint8", "type": "coil", "writable":1}, { "address": 16, "name": "VRV 1 Fan Hizi", "bus_datatype": "uint8", "type": "coil", "writable":1}, { "address": 0, "name": "VRV 1 ON OFF_Status", "bus_datatype": "bool", "type": "discreteinput"}, { "address": 2, "name": "VRV 1 Alarm", "bus_datatype": "bool", "type": "discreteinput"}, { "address": 8, "name": "VRV 1 Mod Status", "bus_datatype": "uint8", "type": "discreteinput"}, { "address": 16, "name": "VRV 1 Fan Hizi Status", "bus_datatype": "uint8", "type": "discreteinput"}, { "address": 0, "name": "VRV 1 Oda Sicakligi", "bus_datatype": "uint16", "type": "inputregister", "value_multiplier": 0.1}, { "address": 1, "name": "VRV 1 Sicaklik Set Deger Status", "bus_datatype": "uint16", "type": "inputregister", "value_multiplier": 0.1}, { "address": 0, "name": "VRV 1 Sicaklik Set Deger", "bus_datatype": "uint16", "type": "register", "value_multiplier": 0.1, "writable":1} ] } RE: Reading 8 coil points as a 1 byte in Modbus - admin - 22.12.2021 It's not possible to do this via a profile, you will have to use scripts. You can access the same RS485 port from both profiles and scripts using mbproxy. You can read multiple coils/inputs via a script and convert to a number. Code: function bitstonumber(bits) The addressing probably starts from 0 so you have to subtract 1 from the documented addresses. Temperature will not work with "value_multiplier": 0.1, try using "datatype": "float16" and "bus_datatype": "float16" without "value_multiplier". RE: Reading 8 coil points as a 1 byte in Modbus - savaskorkmaz - 22.12.2021 Hi I got an error when i use this script in log screen. * table:[2] * string: broadcast read not allowed What could be the reason ? Quote:It's not possible to do this via a profile, you will have to use scripts. You can access the same RS485 port from both profiles and scripts using mbproxy. RE: Reading 8 coil points as a 1 byte in Modbus - admin - 22.12.2021 Check if you have mb:setslave(0) in your code. You don't have to set the slave ID to 1 lower but the coil/register addresses. Script already has correct reading address 8 instead of 9. |