andyf Posted October 5, 2012 Share Posted October 5, 2012 I have a program with a while loop nested inside another while loop. When I run it, the program stops after one iteration of the outer while loop, and exits. When I run "list apc, 1" it reports that the program stopped at the outer while loop conditional statement. Please advise: open prog 1 local Lvar0=0; local Lvar1=0; local Lvar2=0; local Lvar3; L3=ldata.coord abs linear // Enable external time base use Coord[L3].pDesTimeBase=EncTable[8].DeltaPos.a Coord[L3].TimeBaseSlew=1 while( L1 < 5 ) { while ( L2 < 2 ) { x10000 tm500 delay 2000 x30000 tm500 delay 2000 L2++ } L1++ } send 0 "done" sendall close Link to comment Share on other sites More sharing options...
bradp Posted October 17, 2012 Share Posted October 17, 2012 After it stops check the CS feedrate override. Is it 0 or close to it? Link to comment Share on other sites More sharing options...
curtwilson Posted October 17, 2012 Share Posted October 17, 2012 Try increasing the value of Coord[x].GoBack. This parameter is designed to prevent indefinite loops in the program from causing a situation where the next move can't be computed before it is needed to blend from the current move. But you want to be able to jump back in the program twice as you exit the inner loop. Link to comment Share on other sites More sharing options...
andyf Posted November 7, 2012 Author Share Posted November 7, 2012 Thanks Curt, that did the trick. I set Coord[x].GoBack=1, and now I can iterate the outer and inner loops any number of times. Try increasing the value of Coord[x].GoBack. This parameter is designed to prevent indefinite loops in the program from causing a situation where the next move can't be computed before it is needed to blend from the current move. But you want to be able to jump back in the program twice as you exit the inner loop. Link to comment Share on other sites More sharing options...
Recommended Posts