Jump to content
OMRON Forums

while wait


daves

Recommended Posts

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

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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

Guest
This topic is now closed to further replies.

×
×
  • Create New...