amoveb (Auto Mode)

As an asynchronous moveb, this function operates the same as the moveb function except for the asynchronous process, and executes the next line immediately after motion starts without waiting for its termination.

A new motion command issued before the amoveb() motion ends causes an error. Confirm that amoveb() has finished with mwait() or check_motion() before you issue the next motion command.

Definition
DRFLEx.h within class CDRFLEx, public section

bool amoveb(MOVE_POSB tTargetPos[MAX_MOVEB_POINT],
            unsigned char nPosCount,
            float fTargetVel[2],
            float fTargetAcc[2],
            float fTargetTime = 0.f,
            MOVE_MODE eMoveMode = MOVE_MODE_ABSOLUTE,
            MOVE_REFERENCE eMoveReference = MOVE_REFERENCE_BASE,
            DR_MV_APP eAppType = DR_MV_APP_NONE) {
    return _amoveb(_rbtCtrl, tTargetPos, nPosCount, fTargetVel, fTargetAcc,
                   fTargetTime, eMoveMode, eMoveReference, eAppType);
};

Parameter

Parameter Name

Data Type

Default Value

Description

tTargetPos

MOVE_POSB [MAX_MOVEB_POINT]

Path information

nPosCount

unsigned char

Number of valid paths. nPosCount must be 1 to 50.

fTargetVel

float[2]

Linear Velocity, Angular Velocity [mm/s, deg/s]

fTargetAcc

float[2]

Linear Acceleration, Angular Acceleration [mm/s2, deg/s2]

fTargetTime

float

0.f

Reach Time [sec]

eMoveMode

MOVE_MODE

MOVE_MODE_ABSOLUTE

Refer to the Definition of Enumeration Type

eMoveReference

MOVE_REFERENCE

MOVE_REFERENCE_BASE

Refer to the Definition of Enumeration Type

eAppType

DR_MV_APP

DR_MV_APP_NONE

Refer to the Definition of Enumeration Type. Accepted but not sent to the controller.

Note

  • When fTargetTime is specified, motion is processed based on fTargetTime while ignoring fTargetVel.

  • When eMoveMode is MOVE_MODE_RELATIVE, each position in tTargetPos is defined as a relative coordinate with respect to the preceding path.

  • This function does not support online blending of previous and subsequent motions.

Caution

  • A user input error occurs if the blending radius in tTargetPos is 0.

  • A user input error occurs when duplicated Line segments are defined in the same direction.

  • If blending conditions cause rapid directional change, a user input error is generated to prevent sudden acceleration.

  • This function does not support online blending of previous and subsequent motions.

Return

Value

Description

0

Error

1

Success

Note

Returns false without a message when the robot is in STATE_EMERGENCY_STOP, STATE_SAFE_OFF, STATE_SAFE_OFF2, STATE_SAFE_STOP or STATE_SAFE_STOP2.

Example

// Example: Execute an asynchronous multi-segment motion with blending.
// Digital output 1 turns ON 3 seconds after motion starts.
MOVE_POSB xb[4];
memset(xb, 0, sizeof(xb));
unsigned char seqNum = 4;
float tVel[2] = { 50, 50 };   // Linear / Angular Velocity
float tAcc[2] = { 100, 100 }; // Linear / Angular Acceleration

xb[0]._iBlendType = 0;  // Line
xb[0]._fBlendRad = 50;
xb[0]._fTargetPos[0][0] = 559;
xb[0]._fTargetPos[0][1] = 234.5;
xb[0]._fTargetPos[0][2] = 651.5;
xb[0]._fTargetPos[0][3] = 0;
xb[0]._fTargetPos[0][4] = 180;
xb[0]._fTargetPos[0][5] = 0;

xb[1]._iBlendType = 1;  // Circle
xb[1]._fBlendRad = 50;
xb[1]._fTargetPos[0][0] = 559;   // via point
xb[1]._fTargetPos[0][1] = 134.5;
xb[1]._fTargetPos[0][2] = 551.5;
xb[1]._fTargetPos[0][3] = 0;
xb[1]._fTargetPos[0][4] = 180;
xb[1]._fTargetPos[0][5] = 0;
xb[1]._fTargetPos[1][0] = 559;   // end point
xb[1]._fTargetPos[1][1] = 234.5;
xb[1]._fTargetPos[1][2] = 451.5;
xb[1]._fTargetPos[1][3] = 0;
xb[1]._fTargetPos[1][4] = 180;
xb[1]._fTargetPos[1][5] = 0;

xb[2]._iBlendType = 0;  // Line
xb[2]._fBlendRad = 50;
xb[2]._fTargetPos[0][0] = 559;
xb[2]._fTargetPos[0][1] = 434.5;
xb[2]._fTargetPos[0][2] = 451.5;
xb[2]._fTargetPos[0][3] = 0;
xb[2]._fTargetPos[0][4] = 180;
xb[2]._fTargetPos[0][5] = 0;

xb[3]._iBlendType = 0;  // Line
xb[3]._fBlendRad = 50;
xb[3]._fTargetPos[0][0] = 559;
xb[3]._fTargetPos[0][1] = 234.5;
xb[3]._fTargetPos[0][2] = 251.5;
xb[3]._fTargetPos[0][3] = 0;
xb[3]._fTargetPos[0][4] = 180;
xb[3]._fTargetPos[0][5] = 0;

// Execute asynchronous motion
drfl.amoveb(xb, seqNum, tVel, tAcc);

// Trigger output after 3 seconds
std::this_thread::sleep_for(std::chrono::seconds(3));
drfl.set_digital_output(GPIO_CTRLBOX_DIGITAL_INDEX_1, true);

This example performs an asynchronous blended multi-segment motion composed of lines and circular paths. After motion begins, digital output 1 is turned on after 3 seconds while the robot continues its movement.