Please look at this conversation ModbusRTU extension
and the documentation and example at GitHub - rkl099/Appinventor-Modbus: Appinventor ModbusRTU and ModbusTCP 1.1. Extension and app to implement single 16b/32b register read and 16b write. Uppdated for Andoid12.