main() { c=gvarget(17006); //get C-position in PLC units (0.01 degree) m=18000; //180 degree in PLC units (0.01 degree) if (c>m) { do{ c=c-36000; }while (c>m); //remove the whole positive turns }; m=0-m; //-180 degree in PLC units (0.01 degree) if (c0); g0moveA(0x0,0x20,0-c); //C axis, move to C=0 timer=200;do{timer--;}while(timer>0); do { code=gvarget(6060); }while(code!=0x4d);//wait till motion finished timer=100;do{timer--;}while(timer>0); //delay for any case exit(99); };