Clear motion buffer

We need help regarding the following:
In certain situations, we need to cancel the loaded motion frames and for this we want to clear the buffer.
Say the buffer has 3000 motion frames loaded and at a particular instance we want to clear the buffer since the loaded motion is not to be executed. In this case, which function should we use?

We are trying to have a custom “Abort” button in our application.
After pressing this abort button, we want to stop the machine from executing any further motion frames which are added in the buffer, clear the buffer and load the buffer with new motion frames so that the machine only executes the newly added motion frames.

On pressing abort we want the machine to move to a certain location and therefore we want to add those new motion frames after clearing the existing frames in the buffer.

This is the functionality we are trying to achieve.
We don’t know what function is to be used to achieve this functionality. Some guidance regarding regarding this will be deeply appreciated

You can clear the motion buffer by using EStop or EStopModify functions. These will discard any motions you’ve commanded and you’ll have to start over. Abort will also clear out the motion frames in the buffer

Abort is an uncontrolled stop. During it, either momentum -or- potentially an in-drive feature will bring the axis to rest. If you are trying to move the axis to a certain location, what about using one of the other non-streaming motion commands to get you to move to that point? Not having a goal in mind, a MoveVelocity(0, safeDecelerationValue) might be a good choice, if just stopping but no destination is acceptable. Once bringing the axis to reset is complete, the next streaming motion command will start a new buffer.

How does this match or not match your needs?

We need to use MoveSCurve since we want the machine to move to a certain location and then stop.

We are also monitoring every buffer using a parallel thread and we’ve observed that using Estop or EstopModify did not clear the buffer.

We did the following

multi.Estop(); //this did not clear the buffer
axis2.MoveSCurve(0);

We observed that nothing happened on the execution of axis2.MoveSCurve(0);

You need to ClearFaults() after EStop()

Are you using MoveSCurve with RSIMotionAttrMaskAPPEND? If so, turning off the attribute should ensure the next MoveSCurve is an override of the profile rather than an append of the profile

We have tried using Clearfaults after Estop and then MoveSCurve but we did not get the result we wanted. When MoveScurve was executed nothing happened.

Yes we are using the Append attribute. We will try turning it off and then use MoveScurve. Will report back soon.