RapidCode has undergone some constructive changes and refactoring which has slightly altered the API. The benefits of these changes should help create less error-prone user application code, better testing procedures at RSI, easier to maintain, modify, etc.
RapidCode objects have been renamed. All RapidCode objects are now created and initialized using the MotionController object. Many RapidCode methods now require specific enumeration types for parameters, instead of “long” values. SqNode methods are now accessed from an SqNode object, which is contained in Axis and IO objects.
Most RapidCode objects have been renamed for 4.x:
Object creation and initialization is now handled internally by RapidCode. Previously you needed to use the “new” operator to instantiate RapidCode objects. In RapidCode 4.0, objects instantiated within the RapidCode library, so you cannot use the new operator. Axis, MultiAxis and IO objects are now created and initialized by the MotionController object.
From this (2.x): RsiController *controller = new RsiController; controller->InitBoard(0); To this (4.x): MotionController* controller = MotionController::CreateFromBoard(0);
From this (2.x): RsiMultiAxis *multiAxisXY = new RsiMultiAxis; multiAxisXY->Init(controller, axisX); multiAxisXY->AxisAdd(axisY); To this (4.x): MultiAxis* multiAxisXY = controller->MultiAxisGet(axisX); multiAxisXY->AxisAdd(axisY);
Previously, many methods accepted long integer values as parameters. Now any of these specialized parameters will accept RSI enumeration types as parameters. Your compiler should generate errors for methods which require these parameter type changes. Here’s an example of a typical change require with 4.x:
From this (2.x) axis->AmpFaultActionSet( (long) RSIActionABORT); To this (4.x) axis->AmpFaultActionSet( RSIAction::RSIActionABORT );
All Axis and IO objects share the common identity of being SynqNet Nodes. Access to SqNode methods has changed. An SqNode object is now contained inside Axis and IO objects. The SqNode object is created an initialized automatically. See example below.
From this (2.x): io->SqNodeSerialNumberGet(); axis->SqNodeSerialNumberGet(); To this (4.x): io->SqNode->SerialNumberGet(); axis->SqNode->SerialNumberGet();
A few handy operating system methods are now contained in an operating system object in the MotionController. Many of these are used for internal RSI testing, such as Sleep() and KeyGet().
From this (2.x): controller->Sleep(10); controller->KeyGet(); To this (4.x): controller->OS->Sleep(10); controller->OS->KeyGet();
The Axis::GearingEnable() method was changed to accept an Axis object instead of an integer axis number.
// Configure this Axis to follow AxisX Actual Position with a 3:1 ratio. AxisY->GearingEnable(AxisX, RSIAxisMasterTypeAXIS_ACTUAL_POSITION, 3, 1);