◆ GearingEnable() [1/2]

virtual void GearingEnable ( int32_t  masterAxisNumber,
RSIAxisMasterType  masterFeedbackSource,
int32_t  numerator,
int32_t  denominator 
)
pure virtual

Enable this Axis to be follower (slave) using electronic gearing.

ℹ This function is avaliable in RapidCode and RapidSequencer

Part of the Gearing method group.

Description:
GearingEnable enables this Axis to be follower (slave) using electronic gearing.
Parameters
masterAxisNumberAn index that represents the master axis.
masterFeedbackSourceA RSIAxisMasterType value.
numeratorMultiple of counts that slave follows relative to master.
denominatorDivisor of counts that slave follows relative to master.
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:

The gearing ratio will be numerator/denominator.

See also
GearingRatioChange