Create C++ RapidCodeRT Hello World project that runs on the INtime kernel.
#include <stdio.h>
#include "rsi.h"
{
bool hasErrors = false;
{
printf("%s\n", err->text);
hasErrors = true;
}
if (hasErrors)
{
printf("Exiting due to RapidCodeRT creation errors.\n");
exit(1);
}
}
int main(int argc, char* argv[])
{
printf("Hello, RapidCodeRT!\n");
printf("Serial Number: %d \n", controller->SerialNumberGet());
Axis* axis = controller->AxisGet(0);
try {
controller->OS->Sleep(100);
}
}
catch (const std::exception& e)
{
printf("\n%s\n", e.what());
}
printf("Exiting successfully.\n");
controller->Delete();
controller = nullptr;
return 0;
}
double CommandPositionGet()
Get the current command position.
void MoveRelative(double relativePosition, double vel, double accel, double decel, double jerkPct)
Command a relative point-to-point S-Curve motion.
Represents a single axis of motion control. This class provides an interface for commanding motion,...
static MotionController * CreateFromSoftware()
Initialize and start the RMP EtherCAT controller.
Represents the RMP soft motion controller. This class provides an interface to general controller con...
void ClearFaults()
Clear all faults for an Axis or MultiAxis.
int32_t AmpEnableSet(bool enable, int32_t ampActiveTimeoutMilliseconds=AmpEnableTimeoutMillisecondsDefault, bool overrideRestrictedState=false)
Enable all amplifiers.
bool MotionDoneGet()
Check to see if motion is done and settled.
const RsiError *const ErrorLogGet()
Get the next RsiError in the log.
int32_t ErrorLogCountGet()
Get the number of software errors in the error log.
The RapidCode base class. All non-error objects are derived from this class.
Represents the error details thrown as an exception by all RapidCode classes. This class contains an ...
void CheckErrors(RapidCodeObject *rsiObject, const std::source_location &location=std::source_location::current())
Checks for errors in the given RapidCodeObject and throws an exception if any non-warning errors are ...