daves Posted December 20, 2013 Share Posted December 20, 2013 We rely on a WHILE () WAIT line at the top of a motion program to achieve some synchronisation. WAIT Function: Suspend program execution Type: Motion program (PROG and ROT) Syntax: WAIT This command may be used on the same line as a WHILE condition to hold up execution of the program until the condition goes false. When the condition goes false, program execution resumes on the next line. Turbo PMAC will not blend moves through a true WHILE…WAIT loop. What is the equivalent in PPMAC? We may be able to avoid the need for this but I wonder if it has an equivalent if it turns out we must have it. Thanks Dave Link to comment Share on other sites More sharing options...
curtwilson Posted December 21, 2013 Share Posted December 21, 2013 If you don't want to do anything at all, just use empty curly brackets: while (WaitCondition) {} Of course, a more robust method would look like: WaitCycles = 0; while (WaitCondition && WaitCycles < MaxWaitCycles) WaitCycles++; if (WaitCycles < MaxWaitCycles) { DoTask } else { TrapError } Link to comment Share on other sites More sharing options...
Recommended Posts