P
ar
t
2: C
omman
d
s
Moog Animatics SmartMotor™ Developer's Guide, Rev. L
Page 750 of 909
TWAIT(gen#)
Trajectory Wait
APPLICATION:
Program execution and flow control
DESCRIPTION:
Suspend command execution while in trajectory
EXECUTION:
Immediate
CONDITIONAL TO:
Position mode (MP) or torque ramp (MT, TS)
LIMITATIONS:
N/A
READ/REPORT:
N/A
WRITE:
N/A
LANGUAGE ACCESS:
N/A
UNITS:
N/A
RANGE OF VALUES:
N/A
TYPICAL VALUES:
N/A
DEFAULT VALUE:
N/A
FIRMWARE VERSION:
5.x and later
COMBITRONIC:
N/A
DETAILED DESCRIPTION:
The TWAIT command pauses program execution until the Busy Trajectory (Bt) status bit
clears. Normally, program execution and trajectory generation are completely independent.
Regardless of what the motion is doing, the processor executes code from the top down.
For example, if there were three consecutive motion commands, they would all execute
sequentially. Therefore, before the motor could even start to move, the last motion command
would dominate. However, using the TWAIT command allows each move command to occur
and complete.
An alternative to TWAIT is:
WHILE Bt . . . LOOP
The TWAIT command and WHILE Bt construction terminate when the trajectory ends.
Depending on the application, you may wish to perform error checking to ensure that the
move was properly completed within a position-error range.
When in MT mode, the TWAIT command (and Bt bit) will also wait while a TS ramp is in
progress.
The TWAIT command will wait for all trajectories to complete. Be aware that dual-trajectory
operation may not give the expected result. To access the specific trajectory (1 or 2), use the
command form TWAIT(1) or TWAIT(2). Also, note there are associated status bits in status
word 7 (bits 0 and 8).
Part 2: Commands: TWAIT(gen#)