Variable Height Acquisition (VHA)

NI IMAQ

Variable Height Acquisition (VHA)

In some line scan applications, you may not know the exact size of the object or objects you are imaging. One example is a conveyer belt application that acquires continuous line-scan images of objects with multiple sizes. For such applications, you can use a mode of triggered acquisition that allows you to acquire a variable number of lines in a multiple buffered application.

In this mode, you supply the image acquisition device a trigger which asserts when you want to begin capture. The image acquisition device continues to acquire lines until the trigger is unasserted. When the acquisition is complete, the driver returns the number of lines acquired. By using the variable line mode, you acquire only the amount of data that you need. This technology greatly enhances performance by minimizing the total amount of data to process.

Setup for Acquiring a Variable Number of Lines

To set up your system for acquiring a variable number of lines, first determine the size of the largest possible object under inspection. The NI-IMAQ driver software defines the dimensions of an image as width and height. Width is the number of pixels per line and height is the number of lines in the image. When you determine the maximum possible object size, in lines, for your application, enter this number for the height parameter in MAX, as follows:

  1. Launch MAX.
  2. Click Devices and Interfaces»NI-IMAQ Devices»PCI-14xx»XXX, where XXX represents the camera you want to use. Click the Acquisition Parameters tab.
  3. Enter the maximum possible number of lines in the Acquisition Window Height control.

NI-IMAQ uses this line number information to allocate each image into a buffer. This allocation is done prior to the acquisition to ensure that memory is available on the system before the acquisition begins.

Setting Up the Trigger

The VHA trigger can come in any unused external trigger line or RTSI line. The trigger can be either High True or Low True. Acquisition of a buffer begins on the assertion of this trigger line and terminates when the line is deasserted or the number of lines equals the Height parameter set in MAX.

Enabling VHA in Your Code

The actual implementation varies depending on the development application you use, but the concept is the same. Complete the following general steps:

  1. Enable the Variable Height Acquisition attribute or property.
  2. Configure the buffers.
  3. Set up the trigger to Trigger each buffer.
  4. Begin the acquisition.
  5. Check the actual height for each buffer during the acquisition.

Examples

If you install the IMAQ examples for your compiler, you can find a ready-to-run example showing how to acquire a variable number of lines with a line scan camera.

  • In LabVIEW, refer to LL VHA Ring.vi, which is located in the <LabVIEW>\examples\IMAQ\IMAQ Signal IO.llb file, where LabVIEW is location to which <LabVIEW> is installed.
  • In LabWindows/CVI, refer to VHA Ring.prj, which is located in the <CVI>\samples\IMAQ\Signal IO folder.
  • In Microsoft C++ version 6, refer to the <NI-IMAQ>\Sample\MSVC\Signal IO\VHA Ring folder.