55using RSI.RapidCode.dotNET;
61public class Motion : SampleAppTestBase
63 [Test, Timeout(Constants.MAX_TEST_TIME)]
64 public void AbsoluteMotion()
68 axis.
MoveTrapezoidal(Constants.POSITION, Constants.VELOCITY, Constants.ACCELERATION, Constants.DECELERATION);
73 Assert.That(axis.
CommandPositionGet(), Is.EqualTo(Constants.POSITION),
"The command position should be equal to POSITION");
76 [Test, Timeout(Constants.MAX_TEST_TIME)]
77 public void SCurveMotion()
85 Assert.That(axis.
CommandPositionGet(), Is.EqualTo(Constants.POSITION),
"The command position should be equal to POSITION");
88 [Test, Timeout(Constants.MAX_TEST_TIME)]
89 public void FinalVelocity()
92 int finalVelocity = 5;
97 Constants.ACCELERATION,
98 Constants.DECELERATION,
99 Constants.JERK_PERCENT,
105 Assert.That(axis.
CommandVelocityGet(), Is.EqualTo(finalVelocity),
"The command velocity should be equal to FINAL_VELOCITY");
111 [Test, Timeout(Constants.MAX_TEST_TIME)]
112 public void RelativeMotion()
115 axis.
MoveRelative(Constants.POSITION, Constants.VELOCITY, Constants.ACCELERATION, Constants.DECELERATION, Constants.JERK_PERCENT);
121 axis.
MoveRelative(-1 * Constants.POSITION, Constants.VELOCITY, Constants.ACCELERATION, Constants.DECELERATION, Constants.JERK_PERCENT);
126 Assert.That(cmdPositionAfterMove, Is.EqualTo(Constants.POSITION),
"The command position should be equal to POSITION");
130 public void MoveVelocity()
134 axis.
MoveVelocity(Constants.VELOCITY, Constants.ACCELERATION);
139 Assert.That(axis.
CommandVelocityGet(), Is.EqualTo(Constants.VELOCITY),
"The command velocity should be equal to FINAL_VELOCITY");
double CommandPositionGet()
Get the current command position.
void MoveVelocity(double velocity)
void MoveTrapezoidal(double position, double vel, double accel, double decel)
Point-to-point trapezoidal move.
double CommandVelocityGet()
Get the current commanded velocity.
void MoveRelative(double relativePosition, double vel, double accel, double decel, double jerkPct)
Command a relative point-to-point S-Curve motion.
void MoveSCurve(double position, double vel, double accel, double decel, double jerkPct)
Command a point-to-point S-Curve motion.
int32_t MotionDoneWait()
Waits for a move to complete.