17 var hasErrors =
false;
18 var errorStrBuilder =
new System.Text.StringBuilder();
26 var errorMsg = rsiError.isWarning ? $
"WARNING: {rsiError.Message}" : $
"ERROR: {rsiError.Message}";
27 errorStrBuilder.AppendLine(errorMsg);
34 throw new Exception(errorStrBuilder.ToString());
52 Console.WriteLine(
"Starting Network..");
65 for (
int i = 0; i < messagesToRead; i++)
68 throw new SystemException(
"Expected OPERATIONAL state but the network did not get there.");
72 Console.WriteLine(
"Network Started");
94 Console.WriteLine(
"Shutting down the network..");
106 for (
int i = 0; i < messagesToRead; i++)
109 throw new SystemException(
"Expected SHUTDOWN state but the network did not get there.");
113 Console.WriteLine(
"Network Shutdown");
148 throw new Exception($
"Axis {phantomAxis.NumberGet()} is not configured as a phantom axis. Please ensure the axis is set to phantom before calling ConfigurePhantomAxis.");
160 double POSITION_TOLERANCE_MAX = Double.MaxValue / 10.0;
172 string errorMsg = @$
"Axis {phantomAxis.NumberGet()} failed to enter IDLE state after configuring phantom axis.
173 The source of the axis error is: {phantomAxis.SourceNameGet(source)}";
174 throw new Exception(errorMsg);
static void ConfigurePhantomAxis(Axis phantomAxis)
Configures a phantom axis on the controller.
static void SetupControllerForHardware(MotionController controller)
Sets up the controller for hardware use by resetting it and starting the network.
static void StartTheNetwork(MotionController controller)
Starts the network communication for the given MotionController.
static void CheckErrors(RapidCodeObject rsiObject)
Checks for errors in the given RapidCodeObject and throws an exception if any non-warning errors are ...
static void ShutdownTheNetwork(MotionController controller)
Shuts down the network communication for the given MotionController.
Helpers class provides static methods for common tasks in RMP applications.
void HardwareNegLimitActionSet(RSIAction action)
Set the action that will occur when the Hardware Negative Limit Event triggers.
void HardwarePosLimitActionSet(RSIAction action)
Set the action that will occur when the Hardware Positive Limit Event triggers.
RSIMotorType MotorTypeGet()
Get the motor type.
void PositionToleranceCoarseSet(double tolerance)
Set the Coarse Position Tolerance for Axis settling.
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 PositionToleranceFineSet(double tolerance)
Set the Fine Position Tolerance for Axis settling.
void ErrorLimitActionSet(RSIAction action)
Set the action that will occur when the Error Limit Event triggers.
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,...
RSINetworkState NetworkStateGet()
void Reset()
Reset the controller which stops and restarts the RMP firmware.
void NetworkShutdown()
Shutdown the EtherCAT network.
void NetworkStart()
Start the network, doing both a discovery followed by starting to OPERATIONAL state.
const char *const NetworkLogMessageGet(int32_t messageIndex)
int32_t NetworkLogMessageCountGet()
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.
void Abort()
Abort an axis.
RSIState StateGet()
Get the Axis or MultiAxis state.
RSISource SourceGet()
Get the source of an error state for an Axis or MultiAxis.
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 ...
bool isWarning
Whether the error is or is not a warning.
RSINetworkState
State of network.
RSIAction
Action to perform on an Axis.
RSISource
Possible sources that have caused an Error state.