The RMP Motion Controller APIs
RsiError

The RsiError object contains information about any RapidCode API object's error/exception. More...

Attributes

char fileName [RSI_ERROR_TEXT_SIZE]
 source file name
 
char functionName [RSI_ERROR_TEXT_SIZE]
 Function name of the raised the error.
 
bool isWarning
 Whether the error is or is not a warning.
 
int32_t lineNumber
 Source code line number.
 
RSIErrorMessage number
 Error number.
 
int32_t objectIndex
 Object index (0-based index of the object that has the error).
 
char shortText [RSI_ERROR_TEXT_SIZE]
 Error short text.
 

Functions

const char * what () const noexcept
 Returns a null terminated character sequence that may be used to identify the exception.
 

Static Attributes

static constexpr uint32_t RSI_ERROR_TEXT_SIZE = 512U
 Error message text.
 

Description


RSIErrors are thrown from RapidCode API calls and provide useful information for diagnostics and debugging. Objects and all data members are created on the stack and the RsiError object itselt is thrown. The preferred catch is by const reference, but by value will work, too. It is safe to assume that every RapidCode API call can throw an RsiError.

Exception throwing can be disabled for an object instance using RapidCodeObject::ThrowExceptions(false) and enabled using RapidCodeObject::ThrowExceptions(true). It can be disabled across then entire API by calling this function on the MotionController instance if set to false, a log of RsiErrors can be accessed using RapidCodeObject::ErrorLogGet()

Note
Our destructors do NOT have a nothrow guarentee. If this occurs, please provide a reproducible snippet to RSI.
try
{
// something that throws an RsiError()
}
catch (const RSI::RapidCode::RsiError &rsi_error)
{
rsi_error.number;
rsi_error.lineNumber;
rsi_error.objectIndex;
rsi_error.isWarning;
rsi_error.text;
rsi_error.functionName;
rsi_error.shortText;
rsi_error.what();
}
Examples
ControllerInterrupts.cpp, HardwareLimits.cpp, HelperFunctions.h, Memory.cpp, MotionHoldReleasedBySoftwareAddress.cpp, MultiaxisMotion.cpp, PathMotion.cpp, PVTmotionMultiAxis.cpp, SingleAxisSyncOutputs.cpp, StreamingMotionBufferManagement.cpp, SyncOutputWithMotion.cpp, Template.cpp, UpdateBufferPoints.cpp, and UserLimitDigitalInputAction.cpp.

Definition at line 99 of file rsi.h.

RSI::RapidCode::RsiError::number
RSIErrorMessage number
Error number.
Definition: rsi.h:103
RSI::RapidCode::RsiError::isWarning
bool isWarning
Whether the error is or is not a warning.
Definition: rsi.h:109
RSI::RapidCode::RsiError
The RsiError object contains information about any RapidCode API object's error/exception.
Definition: rsi.h:100
RSI::RapidCode::RsiError::objectIndex
int32_t objectIndex
Object index (0-based index of the object that has the error).
Definition: rsi.h:107
RSI::RapidCode::RsiError::functionName
char functionName[RSI_ERROR_TEXT_SIZE]
Function name of the raised the error.
Definition: rsi.h:114
RSI::RapidCode::RsiError::shortText
char shortText[RSI_ERROR_TEXT_SIZE]
Error short text.
Definition: rsi.h:116
RSI::RapidCode::RsiError::lineNumber
int32_t lineNumber
Source code line number.
Definition: rsi.h:105
RSI::RapidCode::RsiError::what
const char * what() const noexcept
Returns a null terminated character sequence that may be used to identify the exception.
Definition: rsi.h:154