User`s guide
Specifying Device and Format Information
3-13
Because the ID is not exposed to users, you can specify any convenient value. For
example, if the device's SDK uses numerical identifiers to indicate a format, use these
values for your format IDs.
You can use IDeviceFormat member functions to perform many tasks, such as,
retrieving the format name and format ID, and determining whether the format is the
default format. For more information about this class, see the Image Acquisition Toolbox
Adaptor Kit API Reference documentation.
Adding an IDeviceFormat Object to an IDeviceInfo Object
After you create the IDeviceFormat object, add it to the IDeviceInfo object
that represents the device. Use the addDeviceFormat() member function of the
IDeviceInfo object, as in the following example:
deviceInfo->addDeviceFormat(deviceFormat,true);
Specifying the Default Format
When you add a format to an IDeviceInfo object, you use the second argument to
the addDeviceFormat() function to specify whether the format should be used as the
default format for the device. The imaqhwinfo function returns the name of the default
format in the DefaultFormat field. To make a format the default, set this argument to
true.
Configuring Device Configuration File (Camera File) Support
Some devices use device configuration files (also known as camera files) to configure
formats and other properties. If a device supports device configuration files, you do not
need to create IDeviceFormat objects. Instead, use the setDeviceFileSupport()
member function of the IDeviceInfo object to indicate that the device supports device
configuration files, as in the following example:
deviceInfo->setDeviceFileSupport(true);
For these devices, users pass the full path of the device configuration file as the third
argument to the videoinput function, instead of specifying a device format string.
Adaptor writers do not need to perform any processing of the device configuration file;
you just pass the file name to the device.