1. IntroductionWhen 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.
2. 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.
3. 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.
4. 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.
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.