1. 程式人生 > >DALSA相機開發--修改參數

DALSA相機開發--修改參數

via llb family -- size div onos min 讀取

DALSA gige相機有兩種方式可以獲取到相機相關參數,一個是讀取相機裏面的xml文件;另外一個是讀取相對應的寄存器的值。

對於修改寄存器的值,有兩個相應的函數:

1)GevSetFeatureValue

函數原型為:

GEV_STATUS GevSetFeatureValue(GEV_CAMEAR_HANDLE handle, const char *feature_name, int value_size, void *value);

2)GevSetFeatureValueAsString

函數原型為:

GEV_STATUS GevSetFeatureValueAsString(GEV_CAMERA_HANDLE handle, const char *feature_name, char *value_string);

兩者之間端區別在於,GevSetFeatureValue 可以配置任意類型(支持的類型)的值,並且需要手動填寫類型。而GevSetFeatureValueAsString 是固定為string類型,只需要填寫相對應端值即可。

還有一個更重要的區別是,GevSetFeatureValue能夠配置的項在文件 cameraregdata.c 中有對應,許多項配置不了,受制於結構體

typedef struct { char featureName[FEATURE_NAME_MAX_SIZE]; // String name of feature for this register.
UINT32 address; // Address for accessing feature in camera (NOREF_ADDR if not in camera). RegAccess accessMode; // RO, WO, RW access allowed. BOOL32 available; // True if feature is available (in camera or not) - False is not available. RegType type; // String, Float, Integer, Enum, Bit
UINT32 regSize; // Size of storage for register (or register set / area). UINT32 regStride; // Increment between register items accessed via selector UINT32 minSelector; // Minimum value for selector (corresponds to base address). UINT32 maxSelector; // Maximum value for selector. GENIREG_VALUE value; // Current value (storage for features not backed by a register). GENIREG_VALUE minValue; // Minimum allowable value. GENIREG_VALUE maxValue; // Maximum allowable value. UINT32 readMask; // AND Mask for read (integers only) UINT32 writeMask; // AND Mask for write (integers only) PGENICAM_FEATURE feature; // Pointer to feature in feature table (future). char selectorName[FEATURE_NAME_MAX_SIZE]; // String name of selector for feature. char indexName[FEATURE_NAME_MAX_SIZE]; // String name of index (second selector)for feature. } GEV_REGISTER, *PGEV_REGISTER;

中accessMode 和 available 等屬性。

而 GevSetFeatureValueAsString 卻能夠配置 featureName存在的項,能力遠遠大於 GevSetFeatureValue 。

DALSA相機開發--修改參數