In a certain part of this program, we are looping through instances of a control module.
The data is stored in a UDT array of 7 elements (CM_Motor[7]).
Before the JSR to the subroutine, we set up the pointer and max limit of instances to scan:
MOV 1 CM_Index
SIZE CM_Motor[0] 0 CM_MAX
Here the index starts at 1, pulls the max number of elements in CM_Motor (7) and the subsequent logic loops through the index until CM_MAX is hit.
However, the SIZE instruction is failing to pull the size of the array into CM_Max. I've tested it, and the SIZE works on other arrays (for other CMs). I also replaced the SIZE instruction with a:
MOV 7 CM_MAX
and it worked fine. So the loop is functioning correctly, it just doesn't like the SIZE instruction.
Additionally, when I do a RSLogix Compare on the version I'm having issues with (as the Base) and a development version (as the Compare) which works fine, the CM_Motor controller tag fails to appear in the compare.
Is it possible to the controller to have a corrupted tag, or maybe the SIZE instruction for that rung was compiled erroneously?
Has anyone else run into this before?
The data is stored in a UDT array of 7 elements (CM_Motor[7]).
Before the JSR to the subroutine, we set up the pointer and max limit of instances to scan:
MOV 1 CM_Index
SIZE CM_Motor[0] 0 CM_MAX
Here the index starts at 1, pulls the max number of elements in CM_Motor (7) and the subsequent logic loops through the index until CM_MAX is hit.
However, the SIZE instruction is failing to pull the size of the array into CM_Max. I've tested it, and the SIZE works on other arrays (for other CMs). I also replaced the SIZE instruction with a:
MOV 7 CM_MAX
and it worked fine. So the loop is functioning correctly, it just doesn't like the SIZE instruction.
Additionally, when I do a RSLogix Compare on the version I'm having issues with (as the Base) and a development version (as the Compare) which works fine, the CM_Motor controller tag fails to appear in the compare.
Is it possible to the controller to have a corrupted tag, or maybe the SIZE instruction for that rung was compiled erroneously?
Has anyone else run into this before?