PXL_RETURN_CODE PxLGetErrorReport (

   HANDLE        hCamera,

   ERROR_REPORT* pErrorReport );



This function returns information of the most recent error occurrence.  When a function call returns an error, it caches the error code and a report on the likely cause of the error.  This information is retrieved by a call to PxLGetErrorReport.  The information in the error report is overwritten the next time a function call returns an error.

  • hCamera is the camera handle.  This value is returned by PxLInitialize.

  • pErrorReport is the pointer to a ERROR_REPORT structure, which contains strings of information about the most recent error occurrence.  This structure is also defined in the file PixeLINKTypes.h.



 PXL_RETURN_CODE rc = PxLXxxx(); // Some PixeLINK Api function. e.g. PxLGetNextFrame.

 if (!API_SUCCESS(rc))


   /* Request and display more information about the error */

   ERROR_REPORT errorReport;

   printf(“Last function to return error was %s\n”, errorReport.strFunctionName);

   printf("Last Error was 0x%X (%s)\n", errorReport.uReturnCode, errorReport.strReturnCode);

   printf("Description: %s\n", errorReport.strReport);



dotNet Usage

ReturnCode rc = Api. ... // Some Pixelink Api function. 

if (!Api.IsSuccess(rc)) 
   // Request and display information about the last received error.

   PixeLINK.ErrorReport errorReport = new PixeLINK.ErrorReport();

   Api.GetErrorReport(hCamera, ref errorReport);

   Console.WriteLine("Function    : " + errorReport.FunctionName);
   Console.WriteLine("Return code : " + errorReport.ReturnCode + " " + errorReport.ReturnCodeName);
   Console.WriteLine("Reason      : " + errorReport.Report);

Comments, Restrictions and Limitations

If no errors have occurred then the return code field of the error report structure is set to ApiSuccess and all other fields are set to null strings.