recondaddy
Member
Hey everyone,
I'm reverse engineering a client's program and I've run across something that I need a sanity check on, involving a COP instruction.
Source Tag (UDDT):
Member 1 = BOOL
Member 2 = BOOL
Member 3 = BOOL
Member 4 = BOOL
Member 5 = BOOL
Member 6 = BOOL
Member 7 = DINT
Member 8 = DINT
Member 9 = BOOL[32]
Member 10 = DINT[8]
Destination Tag:
INT[24]
They have implemented a COP instruction to copy the Source UDDT into all 24 elements of the destination tag.
Here is what I believe is happening:
The COP instruction is copying the source UDDT, bit-by-bit, into the destination tag in this fashion:
Source [BOOL] -> Destination INT[0].0
Source [BOOL] -> Destination INT[0].1
Source [BOOL] -> Destination INT[0].2
Source [BOOL] -> Destination INT[0].3
Source [BOOL] -> Destination INT[0].4
Source [BOOL] -> Destination INT[0].5
Source [DINT] -> Destination INT[0].6 thru INT[2].5
Source [DINT] -> Destination INT[2].6 thru INT[4].5
Source [BOOL[32]] -> Destination INT[4].6 thru INT[6].5
Source [DINT[8]] -> Destination INT[6].6 thru INT[22].5
Do you all agree that this is what is happening?
Thanks for any help you can provide.
I'm reverse engineering a client's program and I've run across something that I need a sanity check on, involving a COP instruction.
Source Tag (UDDT):
Member 1 = BOOL
Member 2 = BOOL
Member 3 = BOOL
Member 4 = BOOL
Member 5 = BOOL
Member 6 = BOOL
Member 7 = DINT
Member 8 = DINT
Member 9 = BOOL[32]
Member 10 = DINT[8]
Destination Tag:
INT[24]
They have implemented a COP instruction to copy the Source UDDT into all 24 elements of the destination tag.
Here is what I believe is happening:
The COP instruction is copying the source UDDT, bit-by-bit, into the destination tag in this fashion:
Source [BOOL] -> Destination INT[0].0
Source [BOOL] -> Destination INT[0].1
Source [BOOL] -> Destination INT[0].2
Source [BOOL] -> Destination INT[0].3
Source [BOOL] -> Destination INT[0].4
Source [BOOL] -> Destination INT[0].5
Source [DINT] -> Destination INT[0].6 thru INT[2].5
Source [DINT] -> Destination INT[2].6 thru INT[4].5
Source [BOOL[32]] -> Destination INT[4].6 thru INT[6].5
Source [DINT[8]] -> Destination INT[6].6 thru INT[22].5
Do you all agree that this is what is happening?
Thanks for any help you can provide.
Last edited: