WebHandler
Member
I believe your problem may be two issues. The one is the difference between COP and CPS instruction. The COP instruction can be interrupted while the CPS disables interrupts, does the copy and then re-enables interrupts. But, excessive use of the CPS instruction can cause significant issues especially when used with movement of large memory blocks. So, CPS should be used only when it is required.
Your other problem has to do with your length. You believe you are moving 4-bytes in to a DINT. But, the length term defines the number destination items. Therefore, you are moving 16-bytes starting at TC_20:Iata[0] into 4 consecutive 32-bit memory locations starting with Data_In.Firmware_Version. I believe you can correct this problem by changing length to 1.
As a test, if you are interested, I believe if you move rung 0 to the end of this group of COPs, you will discover may more issues.
In order to help you more, I would need to see you UDT organization.
Your other problem has to do with your length. You believe you are moving 4-bytes in to a DINT. But, the length term defines the number destination items. Therefore, you are moving 16-bytes starting at TC_20:Iata[0] into 4 consecutive 32-bit memory locations starting with Data_In.Firmware_Version. I believe you can correct this problem by changing length to 1.
As a test, if you are interested, I believe if you move rung 0 to the end of this group of COPs, you will discover may more issues.
In order to help you more, I would need to see you UDT organization.