yes that seemed to make sense to me. I tried to follow your advice but got only this far:
Code:
Code: Select all
//Motor A Range: {0°,820°} X
//Motor B Range: {0°,500°} Y
//Motor C Range: {0°,-950°} Z
//Die Verwendung mehrerer verschachtelter tasks dient nicht der Übersichtlichkeit aber der korrekten Abfolge und Verknüpfung der Bewegungen.
#import "/home/dominik/Desktop/TAIS-HiWi/test nbc/testd.csv" datad[3][2]
void move_x(float pwr, int deg)
{
RotateMotorEx(OUT_A,pwr,deg,1,false,true);
}
void move_y(int pwr, int deg)
{
RotateMotorEx(OUT_B,pwr,deg,1,false,true);
}
void move_z(int pwr, int deg)
{
RotateMotorEx(OUT_C,pwr,deg,1,false,true);
}
string tmp[3][2];
float a[3][2];
float pw,b;
task main()
{
for(int i=0;i<=2;i++)
{
for(int j=0;j<=1;j++)
{
tmp[i][j]=FlattenVar(datad[i][j]);
UnflattenVar(tmp[i][j], a[i][j]);
}
}
pw=a[0][0];
move_x(pw,800);
b=a[0][1];
Wait(b);
move_x(pw,-800);
pw=a[1][0];
move_x(pw,800);
b=a[1][1];
Wait(b);
move_x(pw,-800);
pw=a[2][0];
move_x(pw,800);
b=a[2][1];
Wait(b);
move_x(pw,-800);
}
leads to:
# Status: NBC compilation failed.
# Error: Error parsing expression: datad[__main_7qG2_i_7qG2_001][__main_7qG2_j_7qG2_003]
File "/home/dominik/Dropbox/TAIS-HiWi/test nbc/portalx.nxc" ; line 32
#
#----------------------------------------------------------
# Error: Error parsing expression: tmp[__main_7qG2_i_7qG2_001][__main_7qG2_j_7qG2_003]
File "/home/dominik/Dropbox/TAIS-HiWi/test nbc/portalx.nxc" ; line 34
#
#----------------------------------------------------------
# Error: Error parsing expression: a[__main_7qG2_i_7qG2_001][__main_7qG2_j_7qG2_003]
File "/home/dominik/Dropbox/TAIS-HiWi/test nbc/portalx.nxc" ; line 34
#
#----------------------------------------------------------
# Error: Invalid variable argument: a[__main_7qG2_i_7qG2_001][__main_7qG2_j_7qG2_003]
File "/home/dominik/Dropbox/TAIS-HiWi/test nbc/portalx.nxc" ; line 34
# unflatten a[__main_7qG2_i_7qG2_001][__main_7qG2_j_7qG2_003], __D0main, __constVal0, __constVal0
#----------------------------------------------------------
# Error: Invalid string argument: __constVal0
File "/home/dominik/Dropbox/TAIS-HiWi/test nbc/portalx.nxc" ; line 34
# unflatten a[__main_7qG2_i_7qG2_001][__main_7qG2_j_7qG2_003], __D0main, __constVal0, __constVal0
#----------------------------------------------------------
5 errors during compilation
Thanks for the help so far. It's about time to leave my office now, so I will look for new answers tomorrow morning.
Cheers!