APIs, concepts, guides, and more

◆ CheckErrors()

static 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
AxisConfiguration.cpp, CalculateAccelerationFromVelocity.cpp, ControllerInterrupts.cpp, DifferenceOfPositionUserLimit.cpp, Gantry.cpp, HardwareLimits.cpp, Memory.cpp, MotionHoldReleasedBySoftwareAddress.cpp, MultiaxisMotion.cpp, PVTmotionMultiAxis.cpp, PathMotion.cpp, PhantomAxis.cpp, PointToPoint.cpp, PrintNetworkTopology.cpp, RecordPerformance.cpp, SampleAppsHelper.h, SingleAxisSyncOutputs.cpp, SyncInterrupt.cpp, SyncOutputWithMotion.cpp, Template.cpp, UpdateBufferPoints.cpp, and UserLimitDigitalInputAction.cpp.

Definition at line 194 of file SampleAppsHelper.h.