<< Prev        Next >>

ID : 425

MotionComplete

Function

To judge whether or not a motion instruction is completed.

Syntax

MotionComplete[(arm group number[, mode]])

Guaranteed Entry

Arm group number
Designate an arm group number (0 to 31) by integer type data. When -1 is specified, an arm group already acquired by the own task is designated. This is an optional value. This should be -1 if this is omitted.
Mode
Designate mode by integer type. This is an optional value. This should be "0" if this is omitted.
0 Whether the command has completed or not. (*1)
1 Whether the robot is under operation or stopped. (*2)
(*1) Motion is considered completed when all command values have been output.
(*2) When the robot physically stops (all axis speed are nearly zero), it is deemed stopped.

Return Value

Return the arm group motion status by integer type data.

Arm group status Mode0 Mode1
In motion 0 (False) 0 (False)
Stopping Suspended; Continue stopping 0 (False) -1 (True)
Motion instruction complete status; Not in motion -1 (True) -1 (True)

Description

Motion status of the designated arm group number is returned.

Related Terms

MotionSkip

Attention

If the task has not acquire control of any arm group when "-1" is designated for the argument arm group number, -1 (True) is returned.

Example

'!TITLE "MotionComplete"

Sub Main
  TakeArm Keep = 0
  I1 = 1
  Move P, P0
  Move L, P1, Next

  Do
    If ( ( PosY( CurPos ) > 50 ) And ( I1 = 1 ) ) Then
    'Set the I/O when the Y component of the current value exceeds 50.
      Set IO[10]
      I1 = 0
    End If
  Loop Until MotionComplete( -1, 1 ) 'Move to the next line when the motion is finished.

End Sub

ID : 425

<< Prev        Next >>