MotionController Axis MultiAxis IO IOPoint NetworkNode RsiError
Sample Apps Changelog

RapidCode API

ErrorLog.cpp

Error Log sample application.

This sample application demonstrates how to check errors on creation of RapidCode Objects and catch/throw exceptions througout a program.

Precondition
This sample code presumes that the user has set the tuning paramters(PID, PIV, etc.) prior to running this program so that the motor can rotate in a stable manner.
Warning
This is a sample program to assist in the integration of your motion controller with your application. It may not contain all of the logic and safety features that your application requires.
#include "rsi.h" // Import our RapidCode Library.
using namespace RSI::RapidCode;
void PrintErrors(RapidCodeObject *rsiClass) //Helper Function to print all errors of a given RapidCodeObject
{
RsiError *err;
while (rsiClass->ErrorLogCountGet() > 0)
{
err = rsiClass->ErrorLogGet();
printf("%s\n", err->text);
}
}
void ErrorLogMain()
{
Axis *axisX;
const int AXIS_X = (2);
// Insert the path location of the RMP.rta (usually the RapidSetup folder)
char rmpPath[] = "C:\\RSI\\X.X.X\\";
// Initialize MotionController class.
PrintErrors(controller);
// initialize Axis X
axisX = controller->AxisGet(AXIS_X);
PrintErrors(axisX);
controller->Delete(); // Delete the controller as the program exits to ensure memory is deallocated in the correct order.
system("pause");
}