MotionController Axis MultiAxis IO IOPoint NetworkNode RsiError
Sample Apps Changelog

RapidCode API

SettleCriteria.cpp
#include "rsi.h" // Import our RapidCode Library.
#include "HelperFunctions.h" // Import our SampleApp helper functions.
using namespace RSI::RapidCode;
const int AXIS_NUMBER = 0;
const int POSITION_TOLERANCE_FINE = 200;
const int POSITION_TOLERANCE_COARSE = 300;
const int VELOCITY_TOLERANCE = 12000;
const int SETTLING_TIME = 5;
void PrintResult(Axis *axis, char * Vals)
{
printf("\r%s", Vals);
printf("\nPosition Tolerance Fine : %lf", axis->PositionToleranceFineGet());
printf("\nPosition Tolerance Coarse: %lf", axis->PositionToleranceCoarseGet());
printf("\nVelocity Tolerance : %lf", axis->VelocityToleranceGet());
printf("\nSettling Time : %lf\n\n", axis->SettlingTimeGet());
}
void settleCriteriaMain()
{
MotionController *controller;
Axis *axis;
try
{
// Initialize MotionController class.
SampleAppsCPP::HelperFunctions::CheckErrors(controller);
// initialize Axis class
axis = controller->AxisGet(AXIS_NUMBER);
SampleAppsCPP::HelperFunctions::CheckErrors(axis);
axis->AmpEnableSet(false);
PrintResult(axis, "OLD VALUES \n------------");
//setting new values to Pos_Tol_Fine, Pos_Tol_Coarse, Vel_Tol, Settling_Time
axis->PositionToleranceFineSet(POSITION_TOLERANCE_FINE);
axis->PositionToleranceCoarseSet(POSITION_TOLERANCE_COARSE);
axis->VelocityToleranceSet(VELOCITY_TOLERANCE);
axis->SettlingTimeSet(SETTLING_TIME);
PrintResult(axis, "NEW Values \n------------");
}
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.
}