Questions?


Get in touch with us today and our team of imaging professionals will be pleased to assist you.

Contact Us

Camera Parameter Management Functions

The eSDK API provides the following types of camera parameter management functions:

For information about other types of eSDK API functions, see the eSDK API Functons Overview.

Attribute information

The eSDK API provides the following function for getting general information about attributes:

EVT_CameraGetParamAttr

Description: Retrieves information (such as data type) for a specific attribute.

Prototype:

EVT_ERROR EVT_CameraGetParamAttr(
   CEmergentCamera* camera,
   const char* name,
   EvtParamAttribute* attr
);

Parameters:

  • camera: Camera handle.
  • name: Attribute name.
  • attr: Attribute information returned in this structure.

Return Values:

  • EVT_SUCCESS
  • EVT_ERROR_DEVICE_NOT_CONNECTED
  • EVT_ERROR_SRCH
  • EVT_ERROR_GENICAM_ERROR
  • EVT_ERROR_SOCK
  • EVT_ERROR_GVCP_ACK
  • EVT_GENERAL_ERROR

Usage Example:

EVT_CameraGetParamAttr(camera, "ExposureTime", &attr);

Integer parameter management functions

The eSDK API provides the following functions for handling integer camera attributes:

Unsigned integer parameter management (UInt32):

  • EVT_CameraGetUInt32Param – Get the value of a UInt32 attribute
  • EVT_CameraSetUInt32Param – Set the value of a UInt32 attribute
  • EVT_CameraGetUInt32ParamMax – Get the maximum value of a UInt32 attribute
  • EVT_CameraGetUInt32ParamMin – Get the minimum value of a UInt32 attribute
  • EVT_CameraGetUInt32ParamInc – Get the increment step of a UInt32 attribute

Integer parameter management (Int32):

  • EVT_CameraGetInt32Param – Get the value of an Int32 attribute
  • EVT_CameraSetInt32Param – Set the value of an Int32 attribute
  • EVT_CameraGetInt32ParamMax – Get the maximum value of an Int32 attribute
  • EVT_CameraGetInt32ParamMin – Get the minimum value of an Int32 attribute
  • EVT_CameraGetInt32ParamInc – Get the increment step of an Int32 attribute

EVT_CameraGetUInt32Param

Description: Gets the value of a UInt32 attribute.

Prototype:

EVT_ERROR EVT_CameraGetUInt32Param(
   CEmergentCamera* camera,
   const char* name,
   unsigned int* val
);

Parameters:

  • camera: Camera handle.
  • name: Attribute name.
  • val: Attribute value returned.

Return Values:

  • EVT_SUCCESS
  • EVT_ERROR_DEVICE_NOT_CONNECTED
  • EVT_ERROR_SRCH
  • EVT_ERROR_GENICAM_ERROR
  • EVT_ERROR_SOCK
  • EVT_ERROR_GVCP_ACK
  • EVT_ERROR_GENICAM_NOT_MATCH
  • EVT_GENERAL_ERROR

Usage Example:

EVT_CameraGetUInt32Param(camera, "ExposureTime", &value);

EVT_CameraSetUInt32Param

Description: Sets the value of a UInt32 attribute.

Prototype:

EVT_ERROR EVT_CameraSetUInt32Param(
   CEmergentCamera* camera,
   const char* name,
   unsigned int val
);

Parameters:

  • camera: Camera handle.
  • name: Attribute name.
  • val: Attribute value to set.

Return Values:

  • EVT_SUCCESS
  • EVT_ERROR_DEVICE_NOT_CONNECTED
  • EVT_ERROR_SRCH
  • EVT_ERROR_GENICAM_ERROR
  • EVT_ERROR_SOCK
  • EVT_ERROR_GVCP_ACK
  • EVT_ERROR_GENICAM_NOT_MATCH
  • EVT_GENERAL_ERROR

Usage Example:

EVT_CameraSetUInt32Param(camera, "ExposureTime", 20000);

EVT_CameraGetUInt32ParamMax

Description: Gets the maximum value of a UInt32 attribute.

Prototype:

EVT_ERROR EVT_CameraGetUInt32ParamMax(
   CEmergentCamera* camera,
   const char* name,
   unsigned int* max
);

Parameters:

  • camera: Camera handle.
  • name: Attribute name.
  • max: Attribute maximum value returned.

Return Values:

  • EVT_SUCCESS
  • EVT_ERROR_DEVICE_NOT_CONNECTED
  • EVT_ERROR_SRCH
  • EVT_ERROR_GENICAM_ERROR
  • EVT_ERROR_SOCK
  • EVT_ERROR_GVCP_ACK
  • EVT_ERROR_GENICAM_NOT_MATCH
  • EVT_GENERAL_ERROR

Usage Example:

EVT_CameraGetUInt32ParamMax(camera, "ExposureTime", &maxValue);

EVT_CameraGetUInt32ParamMin

Description: Gets the minimum value of a UInt32 attribute.

Prototype:

EVT_ERROR EVT_CameraGetUInt32ParamMin(
   CEmergentCamera* camera,
   const char* name,
   unsigned int* min
);

Parameters:

  • camera: Camera handle.
  • name: Attribute name.
  • min: Attribute minimum value returned.

Return Values:

  • EVT_SUCCESS
  • EVT_ERROR_DEVICE_NOT_CONNECTED
  • EVT_ERROR_SRCH
  • EVT_ERROR_GENICAM_ERROR
  • EVT_ERROR_SOCK
  • EVT_ERROR_GVCP_ACK
  • EVT_ERROR_GENICAM_NOT_MATCH
  • EVT_GENERAL_ERROR

Usage Example:

EVT_CameraGetUInt32ParamMin(camera, "ExposureTime", &minValue);

EVT_CameraGetUInt32ParamInc

Description: Gets the increment step of a UInt32 attribute.

Prototype:

EVT_ERROR EVT_CameraGetUInt32ParamInc(
   CEmergentCamera* camera,
   const char* name,
   unsigned int* inc
);

Parameters:

  • camera: Camera handle.
  • name: Attribute name.
  • inc: Attribute increment step returned.

Return Values:

  • EVT_SUCCESS
  • EVT_ERROR_DEVICE_NOT_CONNECTED
  • EVT_ERROR_SRCH
  • EVT_ERROR_GENICAM_ERROR
  • EVT_ERROR_SOCK
  • EVT_ERROR_GVCP_ACK
  • EVT_ERROR_GENICAM_NOT_MATCH
  • EVT_GENERAL_ERROR

Usage Example:

EVT_CameraGetUInt32ParamInc(camera, "ExposureTime", &increment);

EVT_CameraGetInt32Param

Description: Gets the value of an Int32 attribute.

Prototype:

EVT_ERROR EVT_CameraGetInt32Param(
   CEmergentCamera* camera,
   const char* name,
   int* val
);

Parameters:

  • camera: Camera handle.
  • name: Attribute name.
  • val: Attribute value returned.

Return Values:

  • EVT_SUCCESS
  • EVT_ERROR_DEVICE_NOT_CONNECTED
  • EVT_ERROR_SRCH
  • EVT_ERROR_GENICAM_ERROR
  • EVT_ERROR_SOCK
  • EVT_ERROR_GVCP_ACK
  • EVT_GENERAL_ERROR

Usage Example:

EVT_CameraGetInt32Param(camera, "Gain", &gainValue);

EVT_CameraSetInt32Param

Description: Sets the value of an Int32 attribute.

Prototype:

EVT_ERROR EVT_CameraSetInt32Param(
   CEmergentCamera* camera,
   const char* name,
   int val
);

Parameters:

  • camera: Camera handle.
  • name: Attribute name.
  • val: Attribute value to set.

Return Values:

  • EVT_SUCCESS
  • EVT_ERROR_DEVICE_NOT_CONNECTED
  • EVT_ERROR_SRCH
  • EVT_ERROR_GENICAM_ERROR
  • EVT_ERROR_SOCK
  • EVT_ERROR_GVCP_ACK
  • EVT_GENERAL_ERROR

Usage Example:

EVT_CameraSetInt32Param(camera, "Gain", 100);

EVT_CameraGetInt32ParamMax

Description: Gets the maximum value of an Int32 attribute.

Prototype:

EVT_ERROR EVT_CameraGetInt32ParamMax(
   CEmergentCamera* camera,
   const char* name,
   int* max
);

Parameters:

  • camera: Camera handle.
  • name: Attribute name.
  • max: Attribute maximum value returned.

Return Values:

  • EVT_SUCCESS
  • EVT_ERROR_DEVICE_NOT_CONNECTED
  • EVT_ERROR_SRCH
  • EVT_ERROR_GENICAM_ERROR
  • EVT_ERROR_SOCK
  • EVT_ERROR_GVCP_ACK
  • EVT_GENERAL_ERROR

Usage Example:

EVT_CameraGetInt32ParamMax(camera, "Gain", &maxGain);

EVT_CameraGetInt32ParamMin

Description: Gets the minimum value of an Int32 attribute.

Prototype:

EVT_ERROR EVT_CameraGetInt32ParamMin(
   CEmergentCamera* camera,
   const char* name,
   int* min
);

Parameters:

  • camera: Camera handle.
  • name: Attribute name.
  • min: Attribute minimum value returned.

Return Values:

  • EVT_SUCCESS
  • EVT_ERROR_DEVICE_NOT_CONNECTED
  • EVT_ERROR_SRCH
  • EVT_ERROR_GENICAM_ERROR
  • EVT_ERROR_SOCK
  • EVT_ERROR_GVCP_ACK
  • EVT_GENERAL_ERROR

Usage Example:

EVT_CameraGetInt32ParamMin(camera, "Gain", &minGain);

EVT_CameraGetInt32ParamInc

Description: Gets the increment step of an Int32 attribute.

Prototype:

EVT_ERROR EVT_CameraGetInt32ParamInc(
   CEmergentCamera* camera,
   const char* name,
   unsigned int* inc
);

Parameters:

  • camera: Camera handle.
  • name: Attribute name.
  • inc: Attribute increment step returned.

Return Values:

  • EVT_SUCCESS
  • EVT_ERROR_DEVICE_NOT_CONNECTED
  • EVT_ERROR_SRCH
  • EVT_ERROR_GENICAM_ERROR
  • EVT_ERROR_SOCK
  • EVT_ERROR_GVCP_ACK
  • EVT_GENERAL_ERROR

Usage Example:

EVT_CameraGetInt32ParamInc(camera, "Gain", &gainInc);

Boolean parameter management functions

The eSDK API provides the following functions for handling Boolean camera attributes:

  • EVT_CameraGetBoolParam – Get the value of a Boolean attribute
  • EVT_CameraSetBoolParam – Set the value of a Boolean attribute
  • EVT_CameraGetBoolParam

    Description: Gets the value of a Boolean attribute.

    Prototype:

    EVT_ERROR EVT_CameraGetBoolParam(
       CEmergentCamera* camera,
       const char* name,
       bool* val
    );

    Parameters:

    • camera: Camera handle.
    • name: Attribute name.
    • val: Attribute value returned.

    Return Values:

    • EVT_SUCCESS
    • EVT_ERROR_DEVICE_NOT_CONNECTED
    • EVT_ERROR_SRCH
    • EVT_ERROR_GENICAM_ERROR
    • EVT_ERROR_SOCK
    • EVT_ERROR_GVCP_ACK
    • EVT_GENERAL_ERROR

    Usage Example:

    EVT_CameraGetBoolParam(camera, "ReverseX", &reverseX);

    EVT_CameraSetBoolParam

    Description: Sets the value of a Boolean attribute.

    Prototype:

    EVT_ERROR EVT_CameraSetBoolParam(
       CEmergentCamera* camera,
       const char* name,
       bool val
    );

    ‍‍Parameters:

    • camera: Camera handle.
    • name: Attribute name.
    • val: Attribute value to set.

    Return Values:

    • EVT_SUCCESS
    • EVT_ERROR_DEVICE_NOT_CONNECTED
    • EVT_ERROR_SRCH
    • EVT_ERROR_GENICAM_ERROR
    • EVT_ERROR_SOCK
    • EVT_ERROR_GVCP_ACK
    • EVT_GENERAL_ERROR

    Usage Example:

    ‍EVT_CameraSetBoolParam(camera, "ReverseX", true);

    String parameter management functions

    The eSDK API provides the following functions for handling string camera attributes:

  • EVT_CameraGetStringParam – Get the value of a string attribute
  • EVT_CameraSetStringParam – Set the value of a string attribute
  • EVT_CameraGetStringParamMaxLength – Get the maximum length of a string attribute
  • EVT_CameraGetStringParam

    Description: Gets the value of a string attribute.

    Prototype:

    EVT_ERROR EVT_CameraGetStringParam(
       CEmergentCamera* camera,
       const char* name,
       char* buffer,
       unsigned long bufferSize,
       unsigned long* valueSize
    );

    Parameters:

    • camera: Camera handle.
    • name: Attribute name.
    • buffer: Buffer for returned string attribute.
    • bufferSize: Size of buffer provided.
    • valueSize: Actual size of returned string attribute.

    Return Values:

    • EVT_SUCCESS
    • EVT_ERROR_DEVICE_NOT_CONNECTED
    • EVT_ERROR_SRCH
    • EVT_ERROR_GENICAM_ERROR
    • EVT_ERROR_SOCK
    • EVT_ERROR_GVCP_ACK
    • EVT_GENERAL_ERROR

    Usage Example:

    char modelName[128];
    unsigned long valueSize;
    EVT_CameraGetStringParam(camera, "DeviceModelName", modelName, sizeof(modelName), &valueSize);

    EVT_CameraSetStringParam

    Description: Sets the value of a string attribute.

    Prototype:

    EVT_ERROR EVT_CameraSetStringParam(
       CEmergentCamera* camera,
       const char* name,
       const char* buffer
    );

    Parameters:

    • camera: Camera handle.
    • name: Attribute name.
    • buffer: Buffer containing the string to write.

    Return Values:

    • EVT_SUCCESS
    • EVT_ERROR_DEVICE_NOT_CONNECTED
    • EVT_ERROR_SRCH
    • EVT_ERROR_GENICAM_ERROR
    • EVT_ERROR_SOCK
    • EVT_ERROR_GVCP_ACK
    • EVT_GENERAL_ERROR

    Usage Example:

    EVT_CameraSetStringParam(camera, "DeviceUserID", "Camera123");

    EVT_CameraGetStringParamMaxLength

    Description: Gets the maximum allowable length, in bytes, of a specified string attribute for the camera.

    Prototype:

    EVT_ERROR EVT_CameraGetStringParamMaxLength(
      CEmergentCamera* camera,
      const char* name,
      int* max
    );

    Parameters:

    • camera: Camera handle.
    • name: Name of the string attribute.
    • max: Pointer to an integer where the function will store the maximum length of the string attribute.

    Return Values:

    • EVT_SUCCESS – Function completed successfully.
    • EVT_ERROR_DEVICE_NOT_CONNECTED – Device is not connected.
    • EVT_ERROR_SRCH – Specified attribute not found.
    • EVT_ERROR_GENICAM_ERROR – GenICam error occurred.
    • EVT_ERROR_SOCK – Socket error occurred.
    • EVT_ERROR_GVCP_ACK – GVCP acknowledgement error.
    • EVT_ERROR_GENICAM_NOT_MATCH – Attribute type does not match.
    • EVT_GENERAL_ERROR – General error occurred.

    Usage Example:

    int maxLength;
    EVT_CameraGetStringParamMaxLength(camera, "DeviceModelName", &maxLength);

    Enumeration parameter management functions

    The eSDK API provides the following functions for handling enumeration (enum) attributes:

  • EVT_CameraGetEnumParam – Get the value of an enumeration attribute
  • EVT_CameraSetEnumParam – Set the value of an enumeration attribute
  • EVT_CameraGetEnumParamRange – Get the range of an enumeration attribute
  • EVT_CameraGetEnumParam

    Description: Gets the value of an enumeration attribute.

    Prototype:

    EVT_ERROR EVT_CameraGetEnumParam(
       CEmergentCamera* camera,
       const char* name,
       char* buffer,
       unsigned long bufferSize,
       unsigned long* valueSize
    );

    Parameters:

    • camera: Camera handle.
    • name: Attribute name.
    • buffer: Buffer for returned enum attribute.
    • bufferSize: Size of buffer provided.
    • valueSize: Actual size of returned string attribute.

    Return Values:

    • EVT_SUCCESS
    • EVT_ERROR_DEVICE_NOT_CONNECTED
    • EVT_ERROR_SRCH
    • EVT_ERROR_GENICAM_ERROR
    • EVT_ERROR_SOCK
    • EVT_ERROR_GVCP_ACK
    • EVT_GENERAL_ERROR

    Usage Example:

    char pixelFormat[128];
    unsigned long valueSize;
    EVT_CameraGetEnumParam(camera, "PixelFormat", pixelFormat, sizeof(pixelFormat), &valueSize);

    EVT_CameraSetEnumParam

    Description: Sets the value of an enumeration attribute.

    Prototype:

    EVT_ERROR EVT_CameraSetEnumParam(
       CEmergentCamera* camera,
       const char* name,
       const char* buffer
    );

    Parameters:

    • camera: Camera handle.
    • name: Attribute name.
    • buffer: Enum attribute value to set.

    Return Values:

    • EVT_SUCCESS
    • EVT_ERROR_DEVICE_NOT_CONNECTED
    • EVT_ERROR_SRCH
    • EVT_ERROR_GENICAM_ERROR
    • EVT_ERROR_SOCK
    • EVT_ERROR_GVCP_ACK
    • EVT_GENERAL_ERROR

    Usage Example:

    EVT_CameraSetEnumParam(camera, "PixelFormat", "Mono8");

    EVT_CameraGetEnumParamRange

    Description: Retrieves the range of possible values for an enumeration attribute as a comma-separated list.

    Prototype:

    EVT_ERROR EVT_CameraGetEnumParamRange(
      CEmergentCamera* camera,
      const char* name,
      char* buffer,
      unsigned long bufferSize,
      unsigned long* valueSize
    );

    Parameters:

    • camera: Camera handle.
    • name: Name of the enumeration attribute.
    • buffer: Buffer to store the comma-separated list of enum values.
    • bufferSize: Size of the provided buffer.
    • valueSize: Actual size of the returned comma-separated list.

    Return Values:

    • EVT_SUCCESS – Function completed successfully.
    • EVT_ERROR_DEVICE_NOT_CONNECTED – Device is not connected.
    • EVT_ERROR_SRCH – Specified attribute not found.
    • EVT_ERROR_GENICAM_ERROR – GenICam error occurred.
    • EVT_ERROR_SOCK – Socket error occurred.
    • EVT_ERROR_GVCP_ACK – GVCP acknowledgement error.
    • EVT_ERROR_GENICAM_NOT_MATCH – Attribute type does not match.
    • EVT_GENERAL_ERROR – General error occurred.

    Usage Example:

    char enumRange[256];
    unsigned long rangeSize;
    EVT_CameraGetEnumParamRange(camera, "PixelFormat", enumRange, sizeof(enumRange), &rangeSize);

    Updated on
    November 19, 2024
    Questions?


    Get in touch with us today and our team of imaging professionals will be pleased to assist you.

    Contact Us