Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Program aborts in while loop
We defined a g-code which sets some variables and then fsaves. We are using the recommended code for sending a command:

Ldata.CmdStatus = 1
do dwell 0
while( Ldata.CmdStatus == 1)

We have found that sometimes (maybe one in 20 program executions) the program aborts while inside the while loop. I figured this out by setting a variable in the while loop and clearing it after. I found that the variable is set when the program aborts. It doesn't set any error flags that I've found when this happens.

I found this previous thread which recommends setting Coord[x].GoBack to deal with a similar-sounding situation:

I set GoBack to 1 and we will see if that helps us. However I am confused about how Coord[x].GoBack behaves. According to the manual:

"When this function detects (GoBack + 2) jumps back in the program while looking for the next command that creates equations of motion of sufficient time, it automatically recalculates the end of the most recently calculated move to bring it to a stop at its programmed endpoint, just as if there were a dwell command after the move."

So it sounds as if a lower value of GoBack should simply result in the equivalent of a dwell 0 being inserted into the program. But I already have a dwell 0 in each loop. So does GoBack behave differently from the manual? Or is something else going on?

Messages In This Thread
Program aborts in while loop - maxvoxel8 - 08-08-2019, 03:31 PM

Forum Jump:

Users browsing this thread: 1 Guest(s)