I am using Kuka Krc2 for welding. Sometimes while Robot is working, he stop in the middle of welding and show error
''array index inadmissible''. Please if somebody can help me. Thanks
Array index inadmissible
-
rlazar989 -
November 26, 2018 at 10:47 PM -
Thread is marked as Resolved.
-
-
Lets say you have declared a one dimensional array of type E6POS like this:
Code;They can be also initialized XTP[1]={X 9999.00,Y 9999.00,Z 9999.00,A 0.0,B 0.0,C 0.0,S 0,T 0,E1 0.0,E2 0.0,E3 0.0,E4 0.0,E5 0.0,E6 0.0} XTP[2]={X 9999.00,Y 9999.00,Z 9999.00,A 0.0,B 0.0,C 0.0,S 0,T 0,E1 0.0,E2 0.0,E3 0.0,E4 0.0,E5 0.0,E6 0.0} XTP[3]={X 9999.00,Y 9999.00,Z 9999.00,A 0.0,B 0.0,C 0.0,S 0,T 0,E1 0.0,E2 0.0,E3 0.0,E4 0.0,E5 0.0,E6 0.0}
If you try to read or write into, say XTP[4] which is not within the declared index range, you will receive the error message "array index inadmissible''. You can not use what does not exit.
Note: KUKA index starts from 1, not from 0.
-
It will be necessary to examine the actual line of code that generates this error, and see what array is being accessed. You will need to find this. It may require opening folded code. It is also possible that this may be occurring in the SPS -- does the SPS stop when this error occurs?
Probably, the faulty program code will look something like this:
CodeArray[IntegerVariable] = AnotherVariable ; writing to array ;or AnotherVariable = Array[InegerVariable]
Once you have determined the real names of Array and IntegerVariable, you will need to monitor IntegerVariable to see when it is exceeding the DECL'd size of the array. Any value larger than the array size, or less than 1, can generate that error message.