Modbus control of battery charge for SMA hybrid inverter

Has anybody a working example how to to configure a Modbus data thing using main UI in order to write the SMA modbus registers 40151 (enable/disable battery charge control) and 40149 (charge/discharge power setting)?

@Nanna_Agesen , i would be interested in your comment? You seem to have quite a bit of experience on this field. Many thanks in advance.