Hi @JDControlsLLC ,
Thank you for your patience. When downloading a different CODESYS project, previously retained data will be reset (perhaps through garbage collection) to make room for retained data within the new project. Therefore, to backup the value of CODESYS tags, a possible solution we came up with is using a Data Transfer (Global) object that is bit-triggered to transfer your data from CODESYS to Extended Memory (EM) registers. This will backup the previously retained values to an .emi file on the USB. Then, when you need to restore these values after overwriting the original project, you can plug the USB drive into your HMI and trigger a bit to read and transfer data from the emi file into CODESYS
When you want to retrieve your saved memory again, you set up data transfer objects that go from the EM registers back to the CODESYS memory registers. This is triggered by a separate bit.
Note: Objects 1 and 2 are set to LB 0 and will transfer data from CODESYS registers to EM registers (USB), while objects 3 and 4 do the opposite and transfer the data from EM registers back into CODESYS registers.
Below is a link to a demo project. Note that the EM register method is the easier solution we recommend. However, it can also be done through the recipe database, where a macro is used to retrieve values from the memory registers, store them in the recipe database, and then export them to a USB drive. Later, those values can be imported back in:
Project Demo Link