Total Time Spline
In this spline type, the total time to execute the entire spline motion is specified using the TotalTimeSplineCommand class.
The following sample code executes a simple total time type cubic spline with 9 points. A total time type spline executes the entire spline in the specified amount of time.
//Create the spline channel buffer
wmxlib_AdvancedMotion->advMotion->CreateSplineBuffer(0, 100);
//Set the spline command options
AdvMotion::TotalTimeSplineCommand spl;
spl.dimensionCount = 2;
spl.axis[0] = 0;
spl.axis[1] = 1;
spl.totalTimeMilliseconds = 1000;
//Set the spline point data
AdvMotion::SplinePoint pt[9];
pt[0].pos[0] = 0;
pt[0].pos[1] = 0;
pt[1].pos[0] = 1000;
pt[1].pos[1] = 0;
pt[2].pos[0] = 500;
pt[2].pos[1] = 500;
pt[3].pos[0] = 1000;
pt[3].pos[1] = 1000;
pt[4].pos[0] = 1000;
pt[4].pos[1] = 1500;
pt[5].pos[0] = 0;
pt[5].pos[1] = 1500;
pt[6].pos[0] = 0;
pt[6].pos[1] = 1000;
pt[7].pos[0] = 500;
pt[7].pos[1] = 500;
pt[8].pos[0] = 0;
pt[8].pos[1] = 0;
//Execute the spline command
wmxlib_AdvancedMotion->advMotion->StartCSplinePos(0, &spl, 9, pt);
//Wait for the spline motion to complete
AxisSelection axes;
axes.axisCount = 2;
axes.axis[0] = 0;
axes.axis[1] = 1;
wmxlib_CoreMotion->motion->Wait(&axes);
//Free the spline buffer (normally, the buffer should only be freed at the end of the application)
wmxlib_AdvancedMotion->advMotion->FreeSplineBuffer(0);
The following plots show the two-dimensional trajectory and the velocity and acceleration of each axis when the above sequence is executed from position (0, 0). The specified points are shown in the position plot using black dots.

The following plots show the two-dimensional trajectory and the velocity and acceleration of each axis when the above sequence is executed with a cubic basis spline (StartCBSplinePos) instead of a cubic spline (StartCSplinePos). Compared to a cubic spline, a cubic basis spline approaches but might not pass through each point.
