◆ MotionDoneWait() [2/2]

virtual int32_t MotionDoneWait ( int32_t  waitTimeoutMilliseconds)
pure virtual

Waits for a move to complete.

ℹ This function is avaliable in RapidCode and RapidSequencer

Part of the State and Status method group.

Description:
MotionDoneWait Will poll the Axis to see when the motion is complete and settled. It will timeout after the number of milliseconds specified.

axis->MotionDoneWait() polls axis->MotionDoneGet() every 10ms

Returns
elapsed milliseconds
Parameters
waitTimeoutMillisecondsHow many milliseconds to wait before timing out?
Sample Code:
AbsoluteMotionAnchor
axis.MoveTrapezoidal(Constants.POSITION, Constants.VELOCITY, Constants.ACCELERATION, Constants.DECELERATION);// Command simple trapezoidal motion.
axis.MotionDoneWait();// Wait for motion to be done
//---TEST ASSERT---
Assert.That(axis.CommandPositionGet(), Is.EqualTo(Constants.POSITION), "The command position should be equal to POSITION");
Note
This method polls the state of the axis, and sleeps the task for 10 milliseconds each time the state is checked. You might want to create your own version of this method if you are running in a single threaded environment, so you could do other things while waiting for a motion to complete.

This will throw RSI_MOTION_DONE_WAIT_TIMEOUT if it times out.

See also
InterruptWait, MotionDoneGet