User`s guide

3 Providing Hardware Information
3-8
Specifying Device and Format Information
Every adaptor must include a getAvailHW() function. In this function, you provide
the toolbox with information about the device (or devices) that are currently connected
to the user's system. An adaptor can represent one particular device, multiple devices
supported by a particular vendor, or a class of devices. For example, the toolbox includes
an adaptor for Matrox devices that supports many different framegrabbers provided by
that vendor.
When a user calls the imaqhwinfo function to find out which devices are available on
their system, the toolbox engine calls your adaptor's getAvailHW() function to get this
information. When you implement this function, you determine the names, device IDs,
and format names that the toolbox displays to users.
This section includes the following topics
“Using Objects to Store Device and Format Information” on page 3-8
“Suggested Algorithm” on page 3-9
“Storing Device Information” on page 3-11
“Storing Format Information” on page 3-12
“Storing Adaptor Data” on page 3-17
Using Objects to Store Device and Format Information
The adaptor kit provides three classes to store device and format information:
Adaptor Kit Object Purpose
IHardwareInfo Overall container class for hardware information
IDeviceInfo Container for information about a particular device
IDeviceFormat Container for information about the formats supported by
a particular device
When the toolbox engine calls your adaptor's getAvailHW() function, it passes your
adaptor a handle to an IHardwareInfo object.
For each device you want to make available through your adaptor, you must create an
IDeviceInfo object and then store the object in the IHardwareInfo object. For each