Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Tutorial
NI Supported: Yes
Publish Date: Sep 6, 2006


Feedback


Yes No

Related Categories

Related Links - Developer Zone

Related Links - Products and Services

Variable Height Acquisition

2 ratings | 4.50 out of 5
Print

Overview

From the NI-IMAQ User Manual, Part number 370160B-01, June 2001

Introduction

When you perform a line scan application, you may not know the exact size of the object you are imaging. A good example is a conveyer belt application in which you need to perform a continuous acquisition of objects of multiple sizes. For such applications, National Instruments has introduced a mode of triggered acquisition on its IMAQ PCI/PXI-1409, PCI/PXI-1422, PCI/PXI-1424, and PCI-1428 devices that allows you to acquire a variable number of lines in a multiple buffered application.

In this mode, you supply the IMAQ device with a trigger that is asserted when you want to begin capture. The IMAQ device continues to acquire lines until the trigger is unasserted. Once 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 and store.

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 to image. 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. Once you determine the maximum possible object size, in lines, for your application, enter this number for the height parameter in Measurement & Automation Explorer (MAX), as follows:

1. Launch MAX.

2. Select your camera (Devices and Interfaces»PCI-14xx»your camera) and click the Properties button on the Basics tab.

3. From the Properties page, enter the maximum possible number of lines into the Height control.

NI-IMAQ uses this line number information to allocate the buffers into which each image resides. 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 from 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


While the actual implementation varies depending on whether you use LabVIEW or C, the concept is the same in either case. Perform the following steps to enable VHA in you code:

1. Enable the Variable Height Acquisition attribute or property.

2. Configure your buffers.

3. Set up your trigger to Trigger each buffer.

4. Begin acquisition.

5. Check actual height for each buffer during the acquisition.

Examples


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

In LabVIEW, see LL VHA Ring.vi in the IMAQ Signal IO.llb

In LabWindows/CVI, see  VHA Ring.prj in the CVI Samples folder.

In Microsoft Visual C version 6, see VHA Ring.mdp in the NI-IMAQ Samples folder.

2 ratings | 4.50 out of 5
Print

Reader Comments | Submit a comment »

 

Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).