◆ MovePT()

virtual void MovePT ( RSIMotionType  type,
double *  position,
double *  time,
int32_t  pointCount,
int32_t  emptyCount,
bool  retain,
bool  final 
)
pure virtual

A move commanded by a list of position and time points.

ℹ This function is avaliable in RapidCode

Part of the Streaming Motion method group.

Description:
MovePT fits constant velocity profile segments through the points.
Parameters
typeThe Position/Time motion type (Spline, BSpline, etc)
*positionArray of positions.
*timeArray of times (seconds).
pointCountThe number of points.
emptyCountE-stop generated if there are this number or fewer frames loaded. Use the value �0� to trigger an E-stop when the buffer is empty, or �-1� to not trigger an E-stop. (Typically for PT motion there are two frames per PT point)
retainPoints kept, or not kept.
finalIf True, this is the final point. If False, more points expected.
Note
In most cases, a servo motor has a feedback device mounted. Depending on feedback device resolution, one motor shaft rotation will produce fixed value of counts. Example: motor has a resolution of 8192 counts. This means if 8192 is entered as distance to move, motor will move single revolution. User can implement UserUnitsSet() to change to a different unit (ex: mm, inches, etc) from encoder counts.
Sample Code:
PTmotion
int points = 3; // Specify the total number of streamed points.
int emptyCount = -1; // E-stop generated if there are this number or fewer frames loaded. Use the value “0” to trigger an E-stop when the buffer is empty, or “-1” to not trigger an E-stop. (Typically for PT motion there are two frames per PT point)
double[] positions = { 1.0, 0.5, 0.75 }; // Specify the positions that you want to reach. (it can be n number)
double[] times = { 0.2, 0.3, 0.1 }; // Specify the times in which you want to reach each position. (velocity and acceleration is calculated by the RMP)
//---COMMAND MOTION---
axis.MovePT(RSIMotionType.RSIMotionTypePT,// Specify the type of PT Motion that you want to perform. (RSIMotionType.RSIMotionTypePT, RSIMotionType.RSIMotionTypeBSPLINE, RSIMotionType.RSIMotionTypeBSPLINE2)
positions, // Specify the positions that you want to reach. (it can be n number)
times, // Specify the times in which you want to reach each position. (velocity and acceleration is calculated by the RMP)
points, // Specify the total number of streamed points.
emptyCount, // E-stop generated if there are this number or fewer frames loaded. Use the value “0” to trigger an E-stop when the buffer is empty, or “-1” to not trigger an E-stop. (Typically for PT motion there are two frames per PT point)
false, // Specify whether points are kept, or are not kept.
true); // Specify if this is the last MovePT. (If True, this is the final point. If False, more points expected.)
axis.MotionDoneWait(); // Wait for motion to be completed.
//---ASSERT---
Assert.That(axis.CommandPositionGet(), Is.EqualTo(positions.Last()), "The command position should be equal to last position in the array");
See also
PVT, DifferentMotionTypes, MoveSCurve, MoveTrapezoidal, MovePVT
Examples
SingleAxisSyncOutputs.cpp, SyncOutputWithMotion.cpp, and UpdateBufferPoints.cpp.