SyncRobots Function

Returns the status of a robot whose motion is reserved.

Syntax
SyncRobots

Return Values
Returns the robot motion in a bit, and if not reserved, “0” is returned.

  • bit 0: robotNumber 1
  • bit 1: robotNumber 2
  • :
  • bit 15: robotNumber 16

Description
SyncRobots function checks the motion reservation status of the SYNC parameter of the robot motion commands. The status the SyncRobots checks are displayed in the bit status corresponding to the robot number. Each bit shows either the robot motion is reserved (1) or not (2). You can start the robot motion reserved using the SyncRobots statement.

See Also
SyncRobots

SyncRobots Function Example
The example below uses the SYNC parameter of a motion command and SyncRobots to start the motions of two robots simultaneously.

Function Main
    Xqt Func1
    Xqt Func2
    Do
       Wait 0.1
       If (SyncRobots And &H03) = &H03 Then
        Exit Do
      EndIf
    Loop
SyncRobots 1,2
Fend

Function Func1
  Robot 1
  Motor On
  Go P1 SYNC
Fend

Function Func2
  Robot 2
  Motor On
  Go P1 SYNC
Fend