I have a Kawasaki robot and am running the terminal. My issue is I am trying to remove multiple dimension arrays from my controller. I have had success removing the the single array using the DELETE/L MY_ARRAY[] syntax but this does not remove 2 and 3 dimensional arrays. There is no longer any AS code referring to these arrays.
Trying to clean up our robot, your help is much appreciated
Kawasaki problem with DELETE Multi Dimensional Array
-
elvicash -
October 25, 2023 at 6:32 PM -
Thread is Unresolved
-
-
- Best Answer
DEL/L *array[]
DEL/L *array[,]
DEL/L *array[,,]
-
Exactly right thanks a lot.
The manuals could do with a little more source code and example code. But this was exactly what I needed thank you so much Kwakasaki -
The manuals could do with a little more source code and example code.
For sure but this is a Kawasaki Legacy unfortunately.
The DELETE references arrays and elements in the AS manual.
Albeit, not what you would call a conclusive reference.
-
Rambling question in reply while we are talking Kawasaki arrays. Lets say I am passing arguments into a sub routine program is it possible to pass an entire array into a subroutine or not. If it is possible how do you define the parameters to be an array and how do you use that argument in the subroutine.
If I am passing postions or reals I have to force the type when I call the sub routine for a position variable (& or #) but not for the real type. Then when I use that positional argument in the sub-routine I only use the arguments name with . infront of it but do notuse the & or # but the & or # are required in the definition.I know I can pass a single element of an array but would like to pass an entire array. If it is possible to pass arrays I would expect the caller would have to also pass the max element num or only use predined sizes. The programmer can deal with that but is it possible to pass a reference to an entire arrray to a subroutine.
In the snippet below I would like to pass the 6 element array of reals rthis_xyz[0-5] for now that array is global.
Definition
x.findxyzminmax(.&xcheckpos,.firstpos)
Calling
CALL x.findxyzminmax(&xMypos,TRUE)
Using i.e. inside the routine
.PROGRAM x.findxyzminmax(.&xcheckpos,.firstpos)
;I would like to use a passed in array right here to hold the 6 real values from the position returned by this DECOMPOSE......
DECOMPOSE rthis_xyz[0] = .xcheckpos
IF (.firstpos==TRUE) THEN
;Do FirstPos TRUE stuff here
ELSE
;Do FirstPos FALSE stuff here
.END
-
Ampersands are required if you are passing in locations always.
Yes you can pass arrays in whether single, 2 or 3 dimensional by:
CALL monkey(ape[],chimp[,],gorilla[,,])
You could the use MAXINDEX/MININDEX commands to then find your element value.
These commands are available on D controller upwards, but not C controllers.