15.10.2023, 19:57
This has nothing to do with Modbus slave script..
Using the controller as slave means that you can read/write to the controller from another Modbus master device and is not needed for devices like meters as those are slave devices itself..
You don’t need this script sample for your device, you just need to create a JSON profile with the registers of interest of your metering device and add it to the Modbus tab profiles and create the slave device with correct meter communication settings.
See: https://openrb.com/docs/modbus.htm and the many sample on this forum.
Using the controller as slave means that you can read/write to the controller from another Modbus master device and is not needed for devices like meters as those are slave devices itself..
You don’t need this script sample for your device, you just need to create a JSON profile with the registers of interest of your metering device and add it to the Modbus tab profiles and create the slave device with correct meter communication settings.
See: https://openrb.com/docs/modbus.htm and the many sample on this forum.