Kalle: you are right! It is very hard for me to deal with such a complicated program. But thanks for supporting me
L D: I am comparing the file you have sent with the one I had at first place, I have detected 23 changes and I am trying to find out the idea of these modifications
I used to work with an ex Siemens employee, he showed me how they used to do this. They would write the code and put spaces before the code started.
They would load it onto a PLC and have a 'lock code' block. This block would write to absolute addresses, it would need a FB ID as an input parameter.
On running the code, it would modify the block header to change the code start address to after the spaces and write in the block end instruction in machine code in the spaces.