The RMP Motion Controller API

◆ CheckErrors()

static void CheckErrors ( RapidCodeObject  rsiObject)
static

Check the RSIError log for any logged errors. Read and print all the errors. Ignore warnings.

Parameters
rsiObjectAny RapidCode object. (MotionController, Axis, etc.)
Sample Code:
public static void CheckErrors(RapidCodeObject rsiObject)
{
bool hasErrors = false;
System.Text.StringBuilder errorStringBuilder = new System.Text.StringBuilder();
while (rsiObject.ErrorLogCountGet() > 0)
{
RsiError error = rsiObject.ErrorLogGet();
if (error.isWarning)
{
errorStringBuilder.AppendLine("WARNING: " + error.Message);
}
else
{
hasErrors = true;
errorStringBuilder.AppendLine("ERROR: " + error.Message);
}
}
if (errorStringBuilder.Length > 0)
{
Console.WriteLine(errorStringBuilder.ToString());
}
if (hasErrors)
{
throw new Exception(errorStringBuilder.ToString());
}
}
Examples
AxisConfig.cs, GearingCamming.cs, HelperFunctions.cs, Homing.cs, Motion.cs, MotionHold.cs, MultiAxisMotion.cs, Template.cs, TouchProbe.cs, UserLimit.cs, and VelocitySetByAnalogInputValue.cs.