Thanks for providing this method. This makes good use of the utility.
The issue of the corruption of the database when altering the code records is something SmartLabs is working on. On devices where the embedded PLM has no external memory, the PLM firmware is overwriting the database when other parts of the memory space are written with “peek” commands. We will get around the issue by using extended commands through our EZBridge. Unfortunately the PLC does not support extended commands.
As a practical work-around, please note the link records before altering the code records. Then, modify the code records first, and re-write the link records.