wait_motion_end() { timer=2; do{timer--;}while (timer>0); //wait motion started do { ex=0; code=gvarget(6060); if (code==0x4d) {ex=1;}; if (code==0x57) {ex=1;}; } while(ex==0); }; square() { gvarset(8630,50000); //speed/frequency 50kHz gvarset(8631,100); //Time ~ 0.1sec (in milliseconds) g0moveA(0x01,0x1001,16000); //absolute programming; Y axis; wait_motion_end(); g0moveA(0x01,0x1002,16000); //absolute programming; Y axis; wait_motion_end(); g0moveA(0x01,0x1001,8000); //absolute programming; X axis; wait_motion_end(); g0moveA(0x01,0x1002,8000); //absolute programming; Y axis; wait_motion_end(); };