The camera can detect certain errors. If such an error occurs, the camera assigns an error code to this error and stores the error code in memory.
If several different errors occur, the camera stores the code for each type of error detected. The camera stores each code only once regardless of how many times it has detected the corresponding error.
The following table applies to Basler ace U/L cameras only.
LastError Enumerator
Meaning
NoError
The camera hasn't detected any errors since the last time the error memory was cleared.
Overtrigger
An overtrigger has occurred. The user has applied a trigger signal to the camera when the camera wasn't ready for it.
Userset
An error occurred when attempting to load a user set. Typically, this means that the user set contains an invalid value. Try loading a different user set.
InvalidParameter
A parameter has been entered that is out of range or otherwise invalid. Typically, this error only occurs when the user sets parameters via direct register access.
// Check whether an error occurred on the deviceboolerrorPresent=camera.BslErrorPresent.GetValue();// Get the first error codeint64_terrorReportValue=camera.BslErrorReportValue.GetValue();// Retrieve the next error code from the devicecamera.BslErrorReportNext.Execute();
INodeMap&nodemap=camera.GetNodeMap();// Check whether an error occurred on the deviceboolerrorPresent=CBooleanParameter(nodemap,"BslErrorPresent").GetValue();// Get the first error codeint64_terrorReportValue=CIntegerParameter(nodemap,"BslErrorReportValue").GetValue();// Retrieve the next error code from the deviceCCommandParameter(nodemap,"BslErrorReportNext").Execute();
// Check whether an error occurred on the deviceboolerrorPresent=camera.Parameters[PLCamera.BslErrorPresent].GetValue();// Get the first error codeInt64errorReportValue=camera.Parameters[PLCamera.BslErrorReportValue].GetValue();// Retrieve the next error code from the devicecamera.Parameters[PLCamera.BslErrorReportNext].Execute();
/* Macro to check for errors */#define CHECK(errc) if (GENAPI_E_OK != errc) printErrorAndExit(errc)GENAPIC_RESULTerrRes=GENAPI_E_OK;/* Return value of pylon methods */_BoolerrorPresent=false;int64_terrorReportValue=0;/* Check whether an error occurred on the device */errRes=PylonDeviceGetBooleanFeature(hdev,"BslErrorPresent",&errorPresent);CHECK(errRes);/* Get the first error code */errRes=PylonDeviceGetIntegerFeature(hdev,"BslErrorReportValue",&errorReportValue);CHECK(errRes);/* Retrieve the next error code from the device */errRes=PylonDeviceExecuteCommandFeature(hdev,"BslErrorReportNext");CHECK(errRes);
# Check whether an error occurred on the deviceerrorPresent=camera.BslErrorPresent.Value# Get the first error codeerrorReportValue=camera.BslErrorReportValue.Value# Retrieve the next error code from the devicecamera.BslErrorReportNext.Execute()
// Get the value of the last error code in the memoryLastErrorEnumslasterror=camera.LastError.GetValue();// Clear the value of the last error code in the memorycamera.ClearLastError.Execute();
INodeMap&nodemap=camera.GetNodeMap();// Get the value of the last error code in the memoryString_tlasterror=CEnumParameter(nodemap,"LastError").GetValue();// Clear the value of the last error code in the memoryCCommandParameter(nodemap,"ClearLastError").Execute();
// Get the value of the last error code in the memorystringlasterror=camera.Parameters[PLCamera.LastError].GetValue();// Clear the value of the last error code in the memorycamera.Parameters[PLCamera.ClearLastError].Execute();
size_tlen=0;charlasterror_str[64]={0};/* Get the value of the last error code in the memory */len=sizeof(lasterror_str);errRes=PylonDeviceFeatureToString(hdev,"LastError",lasterror_str,&len);CHECK(errRes);/* Clear the value of the last error code in the memory */errRes=PylonDeviceExecuteCommandFeature(hdev,"ClearLastError");CHECK(errRes);
# Get the value of the last error code in the memorylasterror=camera.LastError.Value# Clear the value of the last error code in the memorycamera.ClearLastError.Execute()