MotionController Axis MultiAxis IO IOPoint NetworkNode RsiError
Sample Apps Changelog

RapidCode API

ConfigAmpFault.cpp
#include "rsi.h" // Import our RapidCode Library.
#include "HelperFunctions.h" // Import our SampleApp helper functions.
using namespace RSI::RapidCode;
void configAmpFaultMain()
{
const int AXIS_NUMBER = 0;
const int ACTIVE_HIGH = 1;
const int ACTIVE_LOW = 0;
const int ENABLED = 1;
const int DISABLED = 0;
const int AMP_FAULT_DURATION_TIME = 1; //value in seconds
// initialize RsiController class
SampleAppsCPP::HelperFunctions::CheckErrors(controller);
// initialize RsiAxis class
Axis *axis = controller->AxisGet(AXIS_NUMBER);
SampleAppsCPP::HelperFunctions::CheckErrors(axis);
axis->AmpEnableSet(false);
try
{
SampleAppsCPP::HelperFunctions::StartTheNetwork(controller); // [Helper Function] Initialize the network.
//To change AMP_FAULT characteristicpp:
printf("\n AMP_FAULT Action set to ABORT\n");
axis->AmpFaultTriggerStateSet(ACTIVE_LOW);
printf("\n AMP_FAULT Trigger State set to ACTIVE_LOW\n");
axis->AmpFaultDurationSet(AMP_FAULT_DURATION_TIME);
printf("\n AMP_FAULT Duration set to 1.0 second\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.
}