Main Content

Using the IMDF Markup Language

This chapter describes how to use an XML-based markup language to specify source, property, and hardware trigger information in an Imaging Device File (IMDF).


Creating an IMDF is required. Using an IMDF file can simplify the coding of your adaptor's getDeviceAttributes() function. In addition, it is the only convenient way to make help text available for the device-specific properties your adaptor creates.

User Scenario

When a user calls the imaqhwinfo function, the toolbox searches for adaptor DLLs. When it finds a DLL, it also looks for a matching IMDF file in the same directories. If found, the engine stores path information to the IMDF file. An IMDF file must reside in the same directory as your DLL and the .imdf file extension, such as demoimaq.imdf.

When a user calls the videoinput function to create a video input object, the engine reads and processes the IMDF file. When it reads the file, it processes the property, trigger, and source information specified at the top-level of the file. (To understand the hierarchical arrangement of an IMDF file, see Elements of the IMDF Markup Language.)

After reading all the top-level elements, the engine looks for a device element that matches the device the user specified in the videoinput function. If found, the engine then looks for video format element in the device element.

The engine then calls your adaptor's getDeviceAttributes() function, as described in Implementing Get and Set Support for Device-Specific Properties, to set up device properties.

Elements of the IMDF Markup Language

The following figure shows the hierarchical relationship of the elements of the XML-based markup language for IMDF files. The figure shows which elements can be children of other elements. Elements at the top-level of an IMDF file (elements that are children of the ImageAcquisitionInfo element apply to an entire adaptor. Elements that are children of a Device element apply only to that device. To simplify the diagram, all possible subordinate elements are not always shown for elements below the top-level. When used in an IMDF file, elements are called nodes.

Hierarchy of IMDF Elements