![]() |
Modbus slave address/bit - 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 slave address/bit (/showthread.php?tid=6037) |
Modbus slave address/bit - Novodk - 25.06.2025 How do I define a bit number to an address? 51/0/0 should be bit 1 51/0/1 should be bit 2 mb.setswap('w') mb.setfloat16precision(2) mb.setmapping({ ['*'] = { registers = { [12288] = '51/0/0', [12288] = '51/0/1', } } }) RE: Modbus slave address/bit - Daniel - 25.06.2025 For bits you should use coli. RE: Modbus slave address/bit - Novodk - 25.06.2025 I´m trying to replicate exact modbuss points for a client, so we don´t have to change anything on their end. We have 10 points first one 1288bit1 second 12288bit2 etc but how do I define that in the modbus slave script? RE: Modbus slave address/bit - Daniel - 25.06.2025 Register is just 2 byte value regardless of what value you write. This script allows only using numeric objects for registers so you must use extra script which will convert your bits into single value you use on this register. RE: Modbus slave address/bit - PolymorphedCust - 26.06.2025 You don't have a script where I can set the bit mask in a register? So that i write a boolean value to a single bit in a holding register instead of converting to an int? RE: Modbus slave address/bit - admin - 26.06.2025 For master mode use profile together with value_bitmask and write_bitmask fields. RE: Modbus slave address/bit - PolymorphedCust - 26.06.2025 But I can't set the LM up as SLAVE and define a bool value to bitmask in holding register? RE: Modbus slave address/bit - admin - 26.06.2025 Use this, fill the bits table as needed (keys are from 0 to 15 for a single register): Code: bits = { Add a common tag to all input group addresses and map an event script to this. |