Error Code List
A list of the error codes returned when a PUCLIB API function fails (returns a value other than PUC_SUCCEEDED), along with recommended handling for development and operation.
Basic approach to error handling
Section titled “Basic approach to error handling”The C/C++ SDK’s API functions return a PUCRESULT value as the result of processing. Using the check macros provided in the SDK, you can concisely branch on success or failure.
#include "PUCLIB.h"
PUCRESULT res = PUC_OpenDevice2(0, &hDevice);
// Example of using the error check macroif (PUC_CHK_FAILED(res)) { // Handling when an error occurs if (res == PUC_ERROR_DEVICE_OPEN) { // Attempt to reset the device PUC_ResetDevice(deviceNo); }}Error code list (PUCRESULT)
Section titled “Error code list (PUCRESULT)”| Code | Constant name | Overview |
|---|---|---|
0 |
PUC_SUCCEEDED |
Completed successfully |
1 |
PUC_ERROR_UNINITIALIZE |
Not initialized. Run PUC_Initialize() |
2 |
PUC_ERROR_INITIALIZED |
Already initialized |
3 |
PUC_ERROR_NOT_EXIST_DEVICE_NO |
The specified device number does not exist |
4 |
PUC_ERROR_ILLEGAL_DEVICE_HANDLE |
The specified device handle is NULL |
5 |
PUC_ERROR_ILLEGAL_ARG |
The specified argument is NULL or invalid |
6 |
PUC_ERROR_ILLEGAL_RESOLUTION |
The specified resolution cannot be set |
7 |
PUC_ERROR_ILLEGAL_FRAME_RATE |
The specified frame rate cannot be set |
8 |
PUC_ERROR_ILLEGAL_EXPOSE_CLOCK |
The specified exposure or non-exposure period (in clock units) cannot be set |
9 |
PUC_ERROR_DEVICE_OPEN |
Failed to open the device |
10 |
PUC_ERROR_DEVICE_NOTOPEN |
The device is not open |
11 |
PUC_ERROR_DEVICE_READ |
Failed to read data from the device |
12 |
PUC_ERROR_DEVICE_WRITE |
Failed to write data to the device |
13 |
PUC_ERROR_MODULE_LOAD |
Some modules in the SDK could not be loaded |
14 |
PUC_ERROR_LOCK_TIMEOUT |
The function’s exclusive lock processing timed out |
15 |
PUC_ERROR_GET_CMD |
Failed to send a get command to the device |
16 |
PUC_ERROR_SET_CMD |
Failed to send a set command to the device |
17 |
PUC_ERROR_NOTEQUAL_READ_SIZE |
Could not read the intended size of data from the device |
18 |
PUC_ERROR_NOTEQUAL_WRITE_SIZE |
Could not write the intended size of data to the device |
19 |
PUC_ERROR_XFER_DATA_INVALID_HEADER |
The header information of the data received from the device is invalid |
20 |
PUC_ERROR_XFER_DATA_BEGIN |
Could not start the data transfer |
21 |
PUC_ERROR_XFER_DATA_WAIT |
An unexpected problem occurred while waiting for data transfer from the device |
22 |
PUC_ERROR_XFER_DATA_FINISH |
The data transfer did not finish normally |
23 |
PUC_ERROR_XFERRING |
Could not process because a transfer is in progress (for example, changing settings during continuous streaming) |
24 |
PUC_ERROR_RING_BUF_COUNT |
The specified number of ring buffers is invalid |
25 |
PUC_ERROR_SYNC_EXTERNAL |
Could not process because external synchronization is in progress |
26 |
PUC_ERROR_NOTSUPPORT |
This function (feature) is not supported by the connected camera |
27 |
PUC_ERROR_GPU_DECODE_PROCESS |
GPU decoding failed |
28 |
PUC_ERROR_ALLOCATE_BUFFUER |
Failed to allocate the buffer |
29 |
PUC_ERROR_FREE_BUFFER |
Failed to free the buffer |
30 |
PUC_ERROR_GPU_SYNCHRONIZE |
Failed to synchronize GPU processing |
31 |
PUC_ERROR_GPU_MEMORY_COPY |
Failed to copy GPU memory |
32 |
PUC_ERROR_GPU_UNINITIALIZE |
The setup required for GPU processing has not been performed. Run PUC_SetupGPUDecode |
33 |
PUC_ERROR_GET_ADAPTER_INFO |
Failed to retrieve network adapter information (PUC_GetAdaptersInfoList) |
34 |
PUC_ERROR_DETECT_DEVICE |
Failed to search for devices (PUC_DetectDevice2 / PUC_DiscoveryDevice, etc.) |
35 |
PUC_ERROR_SET_NETWORK_SETTING |
Failed to write the network settings to the device (PUC_ForceSetNetworkSetting) |
36 |
PUC_ERROR_DEVICE_CLOSE |
Failed to close the device |
37 |
PUC_ERROR_NO_SYNC |
No external synchronization signal was detected |
Troubleshooting & recovery steps
Section titled “Troubleshooting & recovery steps”When opening the device fails (PUC_ERROR_DEVICE_OPEN)
Section titled “When opening the device fails (PUC_ERROR_DEVICE_OPEN)”If the device open fails even though the camera is recognized, the hardware or a handle left unreleased from a previous session may be the cause.
-
Hardware reset via
PUC_ResetDeviceCall
PUC_ResetDevice(nDeviceNo)to clear the camera’s internal state. -
Retry opening the device
After the reset, run
PUC_OpenDevice2()again.
When the connected camera does not support a feature (PUC_ERROR_NOTSUPPORT)
Section titled “When the connected camera does not support a feature (PUC_ERROR_NOTSUPPORT)”The UC-1.1 and GbE-2 support different features (such as SYNC OUT output magnification and network settings). Rather than branching on the model name, check support in advance with PUC_IsSupported before calling the corresponding API.
