GEV_DEVICE_INTERFACE  pCamera[MAX_CAMERAS] = {0};

GEVLIB_CONFIG_OPTIONS options = {0};

int numCamera = 0;

int camIndex = 0;

GEV_CAMERA_HANDLE handle = NULL;

GenApi::CNodeMapRef Camera;

 

// Set manual XML handling mode for the library.

GevGetLibraryConfigOptions( &options);

options. manual_xml_handling = 1;

GevSetLibraryConfigOptions( &options);

 

// Get camera list.

GevGetCameraList( pCamera, MAX_CAMERAS, &numCamera);

 

// Open the camera you want

GevOpenCamera( &pCamera[camIndex], GevExclusiveMode, &handle);

 

// Retrieve the XML data from the camera

{

int xmlFileSize = 0;

    char *pXmlData;

   BOOL compressed_data = 0;

 

   Gev_RetrieveXMLData( handle, 0, NULL, &xmlFileSize);

   xmlFileSize = (xmlFileSize + 3) & (~3));

   pXmlData = (char *)malloc( xmlFileSize + 1);

   Gev_RetrieveXMLData( handle, xmlFileSize, pXmlData, &xmlFileSize, &compressed_data);

   pXmlData[xmlFileSize ] = 0;

   GenICam::gcstring xmlStr( pXmlData );

 

  // Generate the feature node map from the XML data.

      if (compressed_data)

 {

     Camera._LoadXMLFromZIPData(xmlStr);

 }

 else

 {

     Camera._LoadXMLFromString(xmlStr);

 }

 free(pXmlData);

}

 

// Connect the camera to the feature map

GevConnectFeatures( handle, (void *)&Camera);

 

< … GenApi access to features from here on via Camera object … >

Related Topics

GenICam GenApi Feature Access through XML