using NUnit.Framework;
using RSI.RapidCode.dotNET;
#if DOXYGEN
#endif
[TestFixture]
[Category("Software")]
class GearingCamming : SampleAppTestBase
{
[Test, Timeout(Constants.MAX_TEST_TIME)]
public void Camming()
{
Axis moving_axis = controller.
AxisGet(Constants.MAIN_AXIS_NUMBER);
Axis follower_axis = controller.
AxisGet(Constants.DRIVEN_AXIS_NUMBER);
const double MAIN_VELOCITY = 50;
const double MAIN_ACCELERATION = 20;
double[] movingAxisDistances = { 5, 10, 8 };
double[] followerAxisPositions = { 10, 20, 10 };
movingAxisDistances,
followerAxisPositions,
movingAxisDistances.Length);
Assert.That(follower_axis.
CommandPositionGet(), Is.EqualTo(followerAxisPositions[followerAxisPositions.Length - 1]));
}
[Test, Timeout(Constants.MAX_TEST_TIME)]
public void Gearing()
{
Axis moving_axis = controller.
AxisGet(Constants.MAIN_AXIS_NUMBER);
Axis follower_axis = controller.
AxisGet(Constants.DRIVEN_AXIS_NUMBER);
int numerator = 2;
int denominator = 1;
numerator,
denominator);
Constants.VELOCITY,
Constants.ACCELERATION,
Constants.DECELERATION,
Constants.JERK_PERCENT);
Assert.That(moving_axis.
CommandPositionGet(), Is.EqualTo(Constants.POSITION),
"The command position should be equal to POSITION");
Assert.That(follower_axis.
CommandPositionGet(), Is.EqualTo(Constants.POSITION * (numerator / denominator)),
"The command position should be equal to twice POSITION");
}
}
static void CheckErrors(RapidCodeObject rsiObject)
Check if the RapidCodeObject has any errors.
Helper Functions for checking logged creation errors, starting the network, etc.
double CommandPositionGet()
Get the current command position.
void MoveCamLinear(int32_t masterAxisNumber, RSIAxisMasterType masterFeedbackSource, const double *const masterDistances, const double *const slavePositions, int32_t pointCount)
Enable this Axis to be linear follower (slave) using an electronic cam.
void MoveVelocity(double velocity)
void GearingEnable(int32_t masterAxisNumber, RSIAxisMasterType masterFeedbackSource, int32_t numerator, int32_t denominator)
Enable this Axis to be follower (slave) using electronic gearing.
void MoveSCurve(double position, double vel, double accel, double decel, double jerkPct)
Command a point-to-point S-Curve motion.
Represents a single axis of motion control. This class provides an interface for commanding motion,...
Axis * AxisGet(int32_t axisNumber)
AxisGet returns a pointer to an Axis object and initializes its internals.
int32_t MotionDoneWait()
Waits for a move to complete.
int32_t NumberGet()
Get the axis number.
RSIAxisMasterType
Sources available to a slave Axis for electronic gearing & camming.