Features
This function checks the status of the currently active motion.
Return
|
Value |
Description |
|---|---|
|
0 |
DR_STATE_IDLE (no motion in action) |
|
1 |
DR_STATE_INIT (motion being calculated) |
|
2 |
DR_STATE_BUSY (motion in operation) |
Exception
|
Exception |
Description |
|---|---|
|
DR_Error (DR_ERROR_RUNTIME) |
C extension module error occurred |
|
DR_Error (DR_ERROR_STOP) |
Program terminated forcefully |
Example
Python
#1. The next motion (q99) is executed when an asynchronous motion to q0 begins decelerating
q0 = posj(0, 0, 90, 0, 90, 0)
q99 = posj(0, 0, 0, 0, 0, 0)
amovej (q0, vel=10, acc=20) # Executes the next command immediately after the motion to q0.
while True:
if check_motion()==0: # A motion is completed.
amovej (q99, vel=10, acc=20) # Joint motion to q99.
break
if check_motion()==2: # In motion
pass
mwait(0) # Temporarily suspends the program execution until the motion is terminated.