Specifications

BASIC commands
PROGRAMMING MANUAL 176
Revision 5.0
3.2.283 WAIT LOADED
/i
3.2.284 WAIT UNTIL
/i
Example MOVE(1000)
WAIT IDLE
PRINT "Move Done"
The print statement is printed at the end of the movement.
Example MOVE(1000)
WAIT UNTIL MTYPE=0
PRINT "Movement finished"
The print statement is printed, most of the times BEFORE the movement
starts, and sometimes, when the movement is finished.
Explanation Motion programs and motion sequence work in parallel and unsynchronized.
One complete cycle can occur before the movement is loaded into the buffer.
The program executes MOVE(1000) but the movement is not loaded to the
buffer until the start of the next "motion sequence" so when you check
MTYPE=0, it is 0 because the movement HAS NOT STARTED YET, not
because it has finished.
See also AXIS, WAIT LOADED.
Note
WAIT IDLE is a command specifically designed to wait until the
previous movement has been finished so, it handles the delay
from when the previous command is executed in the program
until the command is correctly loaded in the motion buffer.
Type System command
Syntax WAIT LOADED
Description The WAIT LOADED command suspends program execution until the base
axis has no moves buffered ahead other than the currently executing move.
The command can only be used in a program.
This is useful for activating events at the beginning of a move, or at the end
when multiple moves are buffered together.
WAIT LOADED works on the default basis axis (set with BASE) unless AXIS
is used to specify a temporary base axis.
Arguments N/A
Example ' Switch output 8 ON at start of MOVE(500) and OFF at end
MOVE(800)
MOVE(500)
WAIT LOADED
OP(8,ON)
MOVE(400)
WAIT LOADED
OP(8,OFF)
See also AXIS, WAIT IDLE
Type System command
Syntax WAIT UNTIL condition
Description The WAIT UNTIL command repeatedly evaluates the condition until it is
TRUE. After this program execution will continue. The command can only be
used in a program.
Arguments condition
Any valid BASIC logical expression.
Example In this example, the program waits until the measured position on axis 0
exceeds 150, and then starts a movement on axis 1.
WAIT UNTIL MPOS AXIS(0)>150
MOVE(100) AXIS(1)
Example The expressions evaluated can be as complex as you like provided they fol-
low BASIC syntax, for example:
WAIT UNTIL DPOS AXIS(2) <= 0 OR IN(1) = ON
The above line would wait until the demand position of axis 2 is less than or
equal to 0 or input 1 is on.
See also N/A