Delta Tau Forums
Program aborts in while loop - Printable Version

+- Delta Tau Forums (http://forums.deltatau.com)
+-- Forum: Delta Tau Data Systems (http://forums.deltatau.com/forumdisplay.php?fid=1)
+--- Forum: Power PMAC (http://forums.deltatau.com/forumdisplay.php?fid=2)
+--- Thread: Program aborts in while loop (/showthread.php?tid=2946)



Program aborts in while loop - maxvoxel8 - 08-08-2019

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.php?tid=1041&highlight=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?


RE: Program aborts in while loop - maxvoxel8 - 08-09-2019

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.


RE: Program aborts in while loop - Eric Hotchkiss - 08-22-2019

I'm not sure the go-back idea is relevant, there's a good chance that was about exiting multiple while loops and they wanted blending to work properly. Commands like save and fsave can take some time. Waiting for Ldata.CmdStatus only really makes sure the fsave started, you may need an additional timer to be sure it is finished before sending additional commands.