Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Program aborts in while loop
#1
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
cmd"fsave"
sendallcmds
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:

http://forums.deltatau.com/showthread.ph...ht=sendall

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?
Reply
#2
Update: The error occurred with Coord[x].GoBack set to 1. I tried setting it to 255, and it caused the PMAC to become unresponsive to the NC UI, which I also don't understand. Now testing with the value set back to 3.

Update 2: The error still occurs with Coord[x].GoBack set to 3. So it seems that Coord[x].GoBack is not helping.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)