Hard to understand what you mean ...
Normally in an installation with a PLC and an HMI screen the data is all stored in the PLC. There are no two copies of the data.
The HMI screen reads the data cyclically and can also change some of the data, but the data is always stored in the PLC, If the HMI changes some data it will be updated on the screen in the next cyclic reading.
Also in a Modbus RTU (serial) network there can only be one master, it cannot be that both the PLC and the HMI change data
You can on master side code it so that master is reading setpoints from slave and then compare this data to last values writed from master.
If slave's setpoints differs from masters lastly writed values, then data is changed on slave side after master writed values.
Now you need to copy these readed setpoints from slave to master (so ther is no 2 different masters, but you read or write to / from master depending where is newest setpoints/data)
Then if master have newer setpoints, these are writed to slave (which would be normal way)
But for these you need 2 different modbus guerys for setpoints and you need also store lastly writed data to memory so that you can make compare if slave or master setpoints are newest and which way data is actually moved.)
First, write data only if setpoints are only changed on master side, you need also to write these values to some meory area on master side that you know which data values are writes lastly from master. (save data only if writing was succesful to slave)
Now, on another modbus query you read data from slave (which should have same values than you have writed little bit before)
These readed values are moved to some temp memory on master side also.
Compare these readed values to master's lastly writed values
If both slave and master data is same -> no changes on slave or master and no new writing from master.
If you change data values on master side -> set bit
-> if bit is setted -> write new values to slave. (normal writing)
On next modbus query you again read setpoints from slave.
Then you compare again. If readed data differs from lastly writed values from master, data is changed on slave's HMI panel.
Now you need to copy these readed values to above master's data setpoints
so your master PLC actually readed values from slave and copies them to setpoints)
Now data is readed and both master and slave have same data.
It works but have lot of coding.
This is actually how your PC is writing / reading on MB RTU or TCP.
(If you have PC, you can change data on PC and PLC side, and they are updated to PC or PLC.)
So why you can't change setpoints if only difference is that you have 2 PLCs communicating and on other you have PC and PLC?
On both cases you have 1 master, but if PLC is master you need make all coding on PLC, which is allready inbuild on PC master softwares.