Hello
I’m a student who has a school assignment about a robot and we are using an record array to store our data about different thing like, height, color, position and if the piece is good.
But we need to make sure are date if modified is transferred to the other routines, but we are having difficulties to use the array in a routine. You can see what we have below:
MODULE MainModule
RECORD Stift
string strStift;
bool baanwezig;
num numkleur;
num numhoogte;
robtarget robpunt;
ENDRECORD
Var Stift stiftarray{5}:=
[[“stift1”, True, 10, 1000, [[1,0,0],[1,0,0,0],[1,1,0,0],[11,12.3,9E9,9E9,9E9,9E9]]],
[“stift2”, false, 200, 20,[[1,0,0],[1,0,0,0],[1,1,0,0],[11,12.3,9E9,9E9,9E9,9E9]]],
[“stift3”, True, 30, 30,[[1,0,0],[1,0,0,0],[1,1,0,0],[11,12.3,9E9,9E9,9E9,9E9]]],
[“stift4”, false, 40, 40,[[1,0,0],[1,0,0,0],[1,1,0,0],[11,12.3,9E9,9E9,9E9,9E9]]],
[“stift5”, true, 50, 50,[[1,0,0],[1,0,0,0],[1,1,0,0],[11,12.3,9E9,9E9,9E9,9E9]]]];
!CONST robtarget P_test_kleur:=[[273.53,322.55,187.08],[0.000164752,0.706799,0.707415,-0.000414261],[0,-1,1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
PROC main()
Detectie_Hoogte_en_Kleur stiftarray{5};
FOR i FROM 1 TO Dim(stiftarray,1) DO
TPWrite NumToStr(stiftarray.numhoogte,0);
ENDFOR
ENDPROC
PROC Detectie_Hoogte_en_Kleur (inout num stiftarray{*})
FOR i FROM 1 TO Dim(stiftarray,1) DO
stiftarray{i}.numhoogte:= stiftarray{i}.numhoogte + 40;
!MoveJ stiftarray{i}.robpunt,v20, z50,t_sensor;
ENDFOR
ENDPROC
ENDMODULE
Thanks for your help
Arne Berteloot

