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-homing-akd-drive.cs, axis-homing-ds402-drive.cs, axis-homing-master-based.cs, axis-status.cs, compensator-1d.cs, compensator-2d.cs, compensator-single-axis.cs, error-logs.cs, gcode-motion.cs, gcode-units.cs, io-dedicated.cs, io-general-purpose.cs, io-iopoint-user-buffer.cs, io-iopoint.cs, io-network-pdo-sdo.cs, io-sync-outputs.cs, mathblock-calculate-acceleration-from-velocity.cs, mathblock-difference-of-position-userlimit.cs, mathblock-pdo-copy.cs, path-3d-points.cs, path-motion.cs, and path-setup-gantry.cs.

Definition at line 15 of file _helpers.cs.