APIs, concepts, guides, and more

◆ CheckErrors()

static void CheckErrors ( RapidCodeObject rsiObject)
static
Parameters
rsiObjectPointer to the RapidCodeObject to check for errors.
Exceptions
ExceptionThrown if any non-warning errors are encountered in the error log of the RapidCodeObject.
Code Snippet
public static void CheckErrors(RapidCodeObject rsiObject)
{
var hasErrors = false;
var errorStrBuilder = new System.Text.StringBuilder();
while (rsiObject.ErrorLogCountGet() > 0)
{
// get error
RsiError rsiError = rsiObject.ErrorLogGet();
// get message
var errorMsg = rsiError.isWarning ? $"WARNING: {rsiError.Message}" : $"ERROR: {rsiError.Message}";
errorStrBuilder.AppendLine(errorMsg);
// set flag
hasErrors = !rsiError.isWarning;
}
if (hasErrors)
throw new Exception(errorStrBuilder.ToString());
}
See also
StartTheNetwork
Examples
_setup.cs, axis-config-ampfault.cs, axis-config-hardware-limits.cs, axis-config-phantom-axis.cs, axis-config-settling.cs, axis-config-stop-rate.cs, axis-config-userunits.cs, axis-status.cs, mathblock-calculate-acceleration-from-velocity.cs, mathblock-difference-of-position-userlimit.cs, and mathblock-pdo-copy.cs.

Definition at line 15 of file _helpers.cs.