◆ MoveCamLinear()

virtual void MoveCamLinear ( int32_t  masterAxisNumber,
RSIAxisMasterType  masterFeedbackSource,
double *  masterDistances,
double *  slavePositions,
int32_t  pointCount 
)
pure virtual

Enable this Axis to be linear follower (slave) using an electronic cam.

ℹ This function is avaliable in RapidCode

Part of the Camming method group.

Description:
MoveCamLinear enables this Axis to be linear follower (slave) using an electronic cam.
Parameters
masterAxisNumberWhich Axis is the master? (0 to 31).
masterFeedbackSourceA RSIAxisMasterType value.
*masterDistancesRelative distance btween points on the master.
*slavePositionsPosition of the slave at given master distances.
pointCountNumber of points in the cam table.
Sample Code:
Gearing
//Create RapidCode Objects
Axis moving_axis = controller.AxisGet(Constants.MAIN_AXIS_NUMBER);
SampleAppsCS.HelperFunctions.CheckErrors(moving_axis);
Axis follower_axis = controller.AxisGet(Constants.DRIVEN_AXIS_NUMBER);
SampleAppsCS.HelperFunctions.CheckErrors(follower_axis);
int numerator = 2; // Specify the numerator of the gearing ratio.
int denominator = 1; // Specify the denominator of the gearing ratio.
// Configure the 'follower' axis to be a follow to the 'moving' axis at a ratio of 2:1, that is,
// for every rotation of the Moving Axis axis, the Driven axis will rotate twice.
follower_axis.GearingEnable(moving_axis,
RSIAxisMasterType.RSIAxisMasterTypeAXIS_COMMAND_POSITION, // If NOT using a Phantom Axis, switch to RSIAxisMasterTypeAXIS_ACTUAL_POSITION
numerator,
denominator);
// Perform a S-curve motion on the Moving Axis axis.
moving_axis.MoveSCurve(Constants.POSITION,
Constants.VELOCITY,
Constants.ACCELERATION,
Constants.DECELERATION,
Constants.JERK_PERCENT);
moving_axis.MotionDoneWait(); // Wait for motion to finish.
//---ASSERT---
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");
Notes:
MoveCamLinear is only functional in RapidCode 03.03.XX releases.
See also
MoveCamCubic, FrameBufferSizeGet and FrameBufferSizeSet