Ken Roach
Lifetime Supporting Member + Moderator
I am diagnosing a malfunctioning system that uses ControlLogix (L63 controllers, v16 firmware) and want to run an unusual data handling question past the community.
There is some logic that includes a single-dimensional arrray. The array elements are themselves a UDT.
UDT_AxisHistory_DATA is a UDT of 80 bytes length, made up of BOOLs and DINTs.
FH_Data_N10[51] is an array of 51 of those UDTs, so its datatype is UDT_AxisHistory_DATA[51].
There is logic that's supposed to take just one of those UDT_AxisHistory_DATA UDTs and move it to a single instance of the UDT for display on an HMI. That tag is "HMI_DataDisplay", and it is also a UDT of type UDT_AxisHistory_DATA.
Here, a picture's worth a thousand words:
The original programmer, for whatever reason, used the incorrect Length when he wrote the COP instruction. Because the Source and the Destination are both UDT data types, the Length should properly be 1. He typed in 56. I haven't changed it.
So the question is: When a COP instruction Length requires the COP instruction to get more data than is possible, or put that data somewhere it won't fit.... what happens to the excess data ?
Bonus fact: Axis_History_HMI_Display is a Program-scoped tag and it happens to alphabetically be the last Tag in the Tag Database.
So could the "extra data" go... right over the end of the Tag Database and... into another Tag ?
In a sane world, the COP instruction would stop when it reached the end of the destination datatype.
But I've been chasing so many weird problems on this machine that I'm willing to inquire into some very unlikely ideas.
Are any of you folks familiar enough with the guts of ControlLogix tag databases and the COP instruction to make a suggestion ?
I dimly recall years ago testing this and finding that the data appeared to go harmlessly into nowhere. But that was a test program, not my gremlin-plagued control system.
There is some logic that includes a single-dimensional arrray. The array elements are themselves a UDT.
UDT_AxisHistory_DATA is a UDT of 80 bytes length, made up of BOOLs and DINTs.
FH_Data_N10[51] is an array of 51 of those UDTs, so its datatype is UDT_AxisHistory_DATA[51].
There is logic that's supposed to take just one of those UDT_AxisHistory_DATA UDTs and move it to a single instance of the UDT for display on an HMI. That tag is "HMI_DataDisplay", and it is also a UDT of type UDT_AxisHistory_DATA.
Here, a picture's worth a thousand words:
The original programmer, for whatever reason, used the incorrect Length when he wrote the COP instruction. Because the Source and the Destination are both UDT data types, the Length should properly be 1. He typed in 56. I haven't changed it.
So the question is: When a COP instruction Length requires the COP instruction to get more data than is possible, or put that data somewhere it won't fit.... what happens to the excess data ?
Bonus fact: Axis_History_HMI_Display is a Program-scoped tag and it happens to alphabetically be the last Tag in the Tag Database.
So could the "extra data" go... right over the end of the Tag Database and... into another Tag ?
In a sane world, the COP instruction would stop when it reached the end of the destination datatype.
But I've been chasing so many weird problems on this machine that I'm willing to inquire into some very unlikely ideas.
Are any of you folks familiar enough with the guts of ControlLogix tag databases and the COP instruction to make a suggestion ?
I dimly recall years ago testing this and finding that the data appeared to go harmlessly into nowhere. But that was a test program, not my gremlin-plagued control system.