Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problems with delete lookahead
#1
I have the following subprog:

open subprog disableLookahead
send 2 "disableLookahead: ENTER\n";
if (LOOKAHEAD_BUFFERSIZE != 0) {
dwell 10;
Coord[PARTPROG_CS].LHDistance = 0;
dwell 10;
Ldata.CmdStatus=1;
cmd "&%d delete lookahead", PARTPROG_CS;
sendallcmds; // Force commands from buffer
while (Ldata.CmdStatus > 0) {
send 2 "disableLookahead: IN LOOP Ldata.CmdStatus=%d\n",
Ldata.CmdStatus;
dwell 10;
} // Wait for command to execute
send 2 "disableLookahead: END LOOP Ldata.CmdStatus=%d\n",
Ldata.CmdStatus;
if (Ldata.CmdStatus != 0) {
call StopOnError(ERR_DELETE_LOOKAHEAD_FAIL, 0, 0, -1);
return;
}
dwell 10;
}
send 2 "disableLookahead: EXIT\n";
close

This command works without fail in nearly all conditions. I follow it with a similar subprog that defines the lookahead prior to starting a script in the coordinate system to ensure that the lookahead is set up.

The condition that fails is when I call this subprog after I have rebooted the powerpmac and have started running from a saved configuration. It never fails if I run it having downloaded the configuration from the IDE.

The failure condition is that it gets stuck in the loop waiting for the command to complete:

Port 2: disableLookahead: ENTER
Port 2: disableLookahead: IN LOOP Ldata.CmdStatus=1
Port 2: disableLookahead: IN LOOP Ldata.CmdStatus=1
Port 2: disableLookahead: IN LOOP Ldata.CmdStatus=1
Port 2: disableLookahead: IN LOOP Ldata.CmdStatus=1
Port 2: disableLookahead: IN LOOP Ldata.CmdStatus=1
Port 2: disableLookahead: IN LOOP Ldata.CmdStatus=1
Port 2: disableLookahead: IN LOOP Ldata.CmdStatus=1
Port 2: disableLookahead: IN LOOP Ldata.CmdStatus=1
Port 2: disableLookahead: IN LOOP Ldata.CmdStatus=1
Port 2: disableLookahead: IN LOOP Ldata.CmdStatus=1
etc.

Following a download however, I get the following:
Port 2: disableLookahead: ENTER
Port 2: disableLookahead: IN LOOP Ldata.CmdStatus=1
Port 2: disableLookahead: END LOOP Ldata.CmdStatus=0
Port 2: disableLookahead: EXIT

I would appreciate it if you could give me some ideas as to why the command never completes and indeed how I can debug the situation further.

Thanks
Graham
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)