APIs, concepts, guides, and more

◆ MovePT()

void MovePT ( RSIMotionType type,
const double *const position,
const double *const time,
int32_t pointCount,
int32_t emptyCount,
bool retain,
bool final )
Description:
MovePT moves through position/time points. See Streaming Motion and PT Streaming Motion for more information.
Parameters
typeRSIMotionTypeBSPLINE, etc. ::RSIMotionType.
*positionArray of positions (p) to move through. (positions are in the UserUnits for each Axis)
Axis: [p0, p1, p2, ..., pn]
MultiAxis, assuming the Axis mapping is J0, J1, J2: [J0p0, J1p0, J2p0, ..., J0pn, J1pn, J2pn]
*timeArray of time durations for each point in seconds.
Minimum value is your MotionController sample period. Values must be a multiple of the sample period.
If each point should take one millisecond, your array would be: [0.001, 0.001, 0.001, etc.]
pointCountThe number of position/time points.
emptyCountThe number of motion frames (2 per point) that must be in the RMP firmware's buffer, below which triggers an OUT_OF_FRAMES E-Stop action.
The RapidCode library will load frames to the RMP firmware automatically, when the buffer gets low (1/4 of the MotionController::AxisFrameBufferSizeSet() value).
Set emptyCount high enough such that the duration of frames (2 per point) are greater than the value of EStopTimeGet/Set().
emptyCount must also be smaller than 20% of the MotionController::AxisFrameBufferSizeSet() value.
Using a value of 0 or -1 will result in undefined motion behavior if the firmware frame buffer is starved.
retainPoints kept, or not kept (must be True if you attempt a negative feedrate to back up on path).
finalTrue if this is the final streaming motion call, False if more streaming motion calls will occur before this call's points are finishes.
Note
Non-Blocking Execution Motion commands return instantly and do not pause code execution. Use MotionDoneWait() post-call to block execution until motion completes, or MotionDoneGet() to poll for completion.

Part of the Streaming Motion method group.

Performance
When starting from RSIStateIDLE, MovePT and MovePVT will internally call InterruptEnableSet().
Use MotionAttributeMaskOnSet() with RSIMotionAttrMask::RSIMotionAttrMaskNO_INTERRUPT_ENABLE to disable this behavior, which reduces the time it takes to start the motion.
Be sure to call InterruptEnableSet() once during initialization.

Sample Code:
📜 Streaming Motion: PT
/* Demonstrates PT (Position-Time) streaming motion.
PT motion is the simplest streaming motion requiring only position and time arrays.
The controller calculates velocity and acceleration for each segment.
*/
using RSI.RapidCode; // RSI.RapidCode.dotNET;
Console.WriteLine("📜 Axis Streaming Motion: PT");
int exitCode = 0;
// get rmp objects
try
{
Helpers.CheckErrors(controller);
Helpers.VerifyHardwareUsage(controller);
Helpers.VerifyAxisCount(controller);
Axis axis = controller.AxisGet(Constants.AXIS_0_INDEX);
Helpers.CheckErrors(axis);
// configure phantom axis
if (!Constants.USE_HARDWARE) Helpers.PhantomAxisReset(axis);
int points = 3; // total number of streamed points
int emptyCount = 2; // e-stop generated if there are this number or fewer frames loaded
double[] positions = [1.0, 0.5, 0.75]; // positions to reach
double[] times = [1, 0.5, 2]; // time deltas for each position (velocity and acceleration calculated by RMP)
axis.MovePT(RSIMotionType.RSIMotionTypePT, // type of PT motion (RSIMotionTypePT, RSIMotionTypeBSPLINE, RSIMotionTypeBSPLINE2)
positions, // positions to reach
times, // time deltas
points, // total number of points
emptyCount, // minimum frames before e-stop
false, // whether points are kept
true); // if this is the last MovePT call (true = final point, false = more points expected)
axis.MotionDoneWait(); // wait for motion to complete
Console.WriteLine($"Final position: {axis.CommandPositionGet()}");
// cleanup
Helpers.AbortMotionObject(axis);
exitCode = Constants.EXIT_SUCCESS;
}
// handle errors as needed
catch (Exception e)
{
Console.WriteLine($"❌ Error: {e.Message}");
exitCode = Constants.EXIT_FAILURE;
}
finally
{
controller.Delete(); // dispose
}
return exitCode;
Constants used in the C# sample apps.
Definition _constants.cs:3
const bool USE_HARDWARE
Default: false.
Definition _constants.cs:10
const int EXIT_FAILURE
Exit code for failed execution.
Definition _constants.cs:69
const int AXIS_0_INDEX
Default: 0.
Definition _constants.cs:20
const int AMP_ENABLE_MS
Default: 750.
Definition _constants.cs:35
const int EXIT_SUCCESS
Exit code for successful execution.
Definition _constants.cs:68
Represents a single axis of motion control. This class provides an interface for commanding motion,...
Definition rsi.h:5966
static MotionController * Get()
Get an already running RMP EtherCAT controller.
Represents the RMP soft motion controller. This class provides an interface to general controller con...
Definition rsi.h:800
int32_t MotionDoneWait(int32_t waitTimeoutMilliseconds=WaitForever)
Waits for a move to complete.
int32_t AmpEnableSet(bool enable, int32_t ampActiveTimeoutMilliseconds=AmpEnableTimeoutMillisecondsDefault, bool overrideRestrictedState=false)
Enable all amplifiers.
void MovePT(RSIMotionType type, const double *const position, const double *const time, int32_t pointCount, int32_t emptyCount, bool retain, bool final)
A move commanded by a list of position and time points.
RSIMotionType
PT and PVT streaming motion types.
Definition rsienums.h:1045
Helpers namespace provides utility functions for common tasks in RMP applications.
Definition helpers.h:21
See also
Streaming Motion, PT Streaming Motion, MovePVT
Examples
SingleAxisSyncOutputs.cpp, SyncOutputWithMotion.cpp, UpdateBufferPoints.cpp, axis-motion-streaming-pt-whilestopping.cs, axis-motion-streaming-pt.cs, and io-sync-outputs.cs.