Create C++ RapidCodeRT Hello World project that runs on eRMP.
#include <iostream>
#include "rsi.h"
{
{
printf("%s\n", err->text);
}
}
{
{
std::cout << "Starting Network.." << std::endl;
controller->NetworkStart();
}
{
int messagesToRead = controller->NetworkLogMessageCountGet();
for (int i = 0; i < messagesToRead; i++)
{
std::cout << controller->NetworkLogMessageGet(i) << std::endl;
}
std::cout << "Expected OPERATIONAL state but the network did not get there." << std::endl;
}
else
{
std::cout << "Network Started" << std::endl;
}
}
int main(int argc, char* argv[])
{
CheckErrors(controller);
printf("Hello, World!\n");
printf("Serial Number: %d", controller->SerialNumberGet());
try {
Axis* axis = controller->AxisGet(0);
CheckErrors(axis);
}
return 0;
}
catch (const std::exception& e)
{
printf("\n%s\n", e.what());
}
}
void HardwareNegLimitActionSet(RSIAction action)
Set the action that will occur when the Hardware Negative Limit Event triggers.
double CommandPositionGet()
Get the current command position.
void HardwarePosLimitActionSet(RSIAction action)
Set the action that will occur when the Hardware Positive Limit Event triggers.
void SoftwareNegLimitActionSet(RSIAction action)
Set the action that will occur when the Software Negative Limit Event triggers.
void HomeActionSet(RSIAction action)
Set the action that will occur when the Home Event triggers.
void ErrorLimitActionSet(RSIAction action)
Set the action that will occur when the Error Limit Event triggers.
void MotorTypeSet(RSIMotorType type)
Set the motor type.
void MoveRelative(double relativePosition, double vel, double accel, double decel, double jerkPct)
Command a relative point-to-point S-Curve motion.
void SoftwarePosLimitActionSet(RSIAction action)
Set the action that will occur when the Software Positive Limit Event triggers.
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 ...
@ RSINetworkStateOPERATIONAL
EtherCAT operational, good state.
@ RSIActionNONE
None - do not perform any action.
@ RSIMotorTypePHANTOM
Phantom motor (nothing physically connected).