EasyManua.ls Logo

SICK Ranger E

SICK Ranger E
124 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 8 Reference Manual
Ranger E/D
98 ©SICK AG • Advanced Industrial Sensors • www.sick.com • All rights reserved
iCon API
The setParameterValue() method returns two flags:
updateRequired Other parameters were changed as an effect of changing the
specified parameter’s value.
dataFormatChanged The data format was changed as an effect of changing the
parameter’s value.
If the dataFormatChanged flag is true, your application should retrieve the new data
format string from the camera by using the camera object’s getDataFormat() method,
and update the data format by using the frame grabber object’s setDataFormat()
method.
8.4 Error Handling
Most of the methods in the Camera and FrameGrabber objects return a result code,
indicating whether the operation succeeded or failed. Your application should use this
result code to verify that the system is running properly.
Errors that occur asynchronously – that is, without your application actively calling any
method – are reported by the iCon C++ API to an ErrorHandler object. This could for
example be if the API should detect that the communication to the camera is broken, or if
the frame grabber’s internal queue of buffers is full.
The ErrorHandler class in the API is virtual, so your application should implement a
class that inherits from this class.
The ErrorHandler has one method – onError()which the iCon API calls if an error
should occur. The onError() method has two parameters:
errorLevel An integer that indicates the severity of the error. The enumeration
ErrorLevel can be used for checking the severity:
Message Information, for example the shortest possible cycle time
for a measurement component.
Warning Something was not handled properly, but the system will
continue to work, for example if two components have
overlapping ROIs.
Error The system may not work properly after this.
Fatal The system should be restarted.
err A string containing a description of the error, suitable for logging.
// Example of a simple error handler.
// It implements the onError() method, which is called by the API for
// reporting errors on both the camera and PC side.
class myErrorHandler : public icon::ErrorHandler
{
onError(int errorLevel, const std::string & errorMessage)
{
if (errorLevel = icon::ErrorLevel::Fatal) myHandleUrgentErrors(errorMessage);
else myLogMessage(errorLevel, errorMessage);
}
}

Table of Contents

Related product manuals