BASIC commands
PROGRAMMING MANUAL
201
R
e
vi
si
o
n
1
.0
3.2.310 WAIT LOADED
/i
3.2.311 WAIT UNTIL
/i
Description
The
WAIT IDLE
command suspends program execution until the base axis
has finished executing its current move and any buffered move. The com-
mand can only be used in a program.
WAIT IDLE
works on the default basis
axis (set with
BASE
) unless
AXIS
is used to specify a temporary base axis.
Note: The execution of
WAIT IDLE
does not necessarily mean that the axis
will be stationary in a servo motor system.
Arguments
N/A
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)