The RMP Motion Controller APIs
Template.cpp
#include "rsi.h" // Import our RapidCode Library.
#include "HelperFunctions.h" // Import our SampleApp helper functions.
using namespace RSI::RapidCode;
void TemplateMain(int argc, char *argv[])
{
const int AXIS_X = (0);
const int AXIS_Y = (1);
const int IO_NODE = (7);
Axis *axisX;
Axis *axisY;
MultiAxis *multiAxisXY;
IO *io;
// Create and initialize RsiController class
try
{
// enable one MotionSupervisor for the MultiAxis
controller->MotionCountSet(controller->AxisCountGet() + 1);
// Get Axis X and Y respectively.
axisX = controller->AxisGet(AXIS_X);
axisY = controller->AxisGet(AXIS_Y);
// Initialize a MultiAxis, using the last MotionSupervisor.
multiAxisXY = controller->MultiAxisGet(controller->MotionCountGet() - 1);
multiAxisXY->AxisAdd(axisX);
multiAxisXY->AxisAdd(axisY);
// Initialize an IO.
io = controller->IOGet(IO_NODE);
// Insert your application code here.
}
catch (RsiError const& err)
{
printf("\n%s\n", err.text);
}
controller->Delete(); // Delete the controller as the program exits to ensure memory is deallocated in the correct order.
system("pause"); // Allow time to read Console.
}
RSI::RapidCode::MultiAxis::AxisAdd
void AxisAdd(Axis *axis)
Add an Axis to a MultiAxis group.
RSI::RapidCode::MultiAxis
The MultiAxis object allows you to map two or more axes together and command synchronized motion.
Definition: rsi.h:11271
RSI::RapidCode::RsiError
The RsiError object contains information about any RapidCode API object's error/exception.
Definition: rsi.h:105
RSI::RapidCode::IO
The IO object provides an interface to the inputs and outputs of a network node.
Definition: rsi.h:4221
RSI::RapidCode::MotionController::Delete
void Delete(void)
Delete the MotionController and all its objects.
RSI::RapidCode::MotionController::CreateFromSoftware
static MotionController * CreateFromSoftware()
Initialize and start the RMP EtherCAT controller.
RSI::RapidCode
RSI::RapidCode::MotionController::AxisGet
Axis * AxisGet(int32_t axisNumber)
AxisGet returns a pointer to an Axis object and initializes its internals.
RSI::RapidCode::MotionController::IOGet
IO * IOGet(int32_t nodeNumber)
IOGet returns a pointer to an IO object using its node number and initializes its internals.
RSI::RapidCode::MotionController
The MotionController object represents the RMP INtime soft motion controller.
Definition: rsi.h:770
RSI::RapidCode::MotionController::MotionCountSet
void MotionCountSet(int32_t motionCount)
Set the number of processed Motion Supervisors in the controller.
RSI::RapidCode::Axis
The Axis object manages a single physical axis on a motion controller.
Definition: rsi.h:6118
HelperFunctions.CheckErrors
static void CheckErrors(RapidCodeObject rsiObject)
Check if the RapidCode Object has any errors.
Definition: HelperFunctions.cs:64
RSI::RapidCode::MotionController::MultiAxisGet
MultiAxis * MultiAxisGet(int32_t motionSupervisorNumber)
MultiAxisGet returns a pointer to a MultiAxis object and initializes its internals.
RSI::RapidCode::MotionController::MotionCountGet
int32_t MotionCountGet()
Get the number of Motion Supervisors available in the firmware.
RSI::RapidCode::MotionController::AxisCountGet
int32_t AxisCountGet()
Get the number of axes processing.