You can use MODBUS RTU to change DM data, but if your program will write back an original value after every scan then what you see is only good for 1 scan!
Please check your program to make sure that it is not writing back to the same DM. To verify this you can pause the PLC and then make changes to the DM, then observe it using online monitoring. The data should be changed to what you have assigned it and stays there. If the moment the PLC exits the PAUSE mode and the data change back then you know that your program is responsible for this behavior.