I initially was monitoring a variable so that when it got to 100 at the end of the job it would know it's done. Also the GCode is sending text messages to the program using #300.
What I've found is that the data that's being received in the API is well in advance up to a minute or more to where things are in the code being executed and I do have lookahead turned off.
Code: Select all
IF #50001 ;Prevent G code lookahead from parsing past here
IF #4201 || #4202 THEN GOTO 1000 ;Skip macro if graphing or searching
Code: Select all
double heartbeat = 0;
bool jobRunning = true;
string jobMessages;
string lastjobMessage = string.Empty;
while (jobRunning)
{
jobRunning = CNCPipeManager.IsRunningJob();
heartbeat = CNCPipeManager.GetUserVariable(31550);
jobMessages = CNCPipeManager.GetUserStringVariable(300);
if (!string.Equals(jobMessages, lastjobMessage))
{
lastjobMessage = jobMessages;
DisplayProgress(jobMessages);
}
CycleRunProgress.EditValue = heartbeat;
await Task.Delay(2000);
}
As ever... thanks for all your ideas and help.