APIs, concepts, guides, and more

◆ CheckErrors()

void CheckErrors ( RapidCodeObject * rsiObject)
static
Parameters
rsiObjectPointer to the RapidCodeObject to check for errors.
Exceptions
std::runtime_errorThrown if any non-warning errors are encountered in the error log of the RapidCodeObject.
static void CheckErrors(RapidCodeObject *rsiObject)
{
bool hasErrors = false;
std::string errorStrings("");
while (rsiObject->ErrorLogCountGet() > 0)
{
const RsiError *err = rsiObject->ErrorLogGet();
errorStrings += err->what();
errorStrings += "\n";
if (!err->isWarning)
{
hasErrors = true;
}
}
if (hasErrors)
{
throw std::runtime_error(errorStrings.c_str());
}
}
Examples
ControllerInterrupts.cpp, Gantry.cpp, HardwareLimits.cpp, Memory.cpp, MotionHoldReleasedBySoftwareAddress.cpp, MultiaxisMotion.cpp, PVTmotionMultiAxis.cpp, PathMotion.cpp, SingleAxisSyncOutputs.cpp, SyncInterrupt.cpp, SyncOutputWithMotion.cpp, UpdateBufferPoints.cpp, and UserLimitDigitalInputAction.cpp.

Definition at line 99 of file SampleAppsHelper.h.