Acquisition VIs

NI IMAQ

Acquisition VIs

Two acquisition VI types are available in LabVIEW—high-level and low-level.

High-Level

You can use the high-level acquisition VIs for basic image acquisition applications. NI-IMAQ includes VIs for snap, grab, and sequence as described in NI-IMAQ Acquisition Types. You can find examples of using the high-level acquisition VIs in the <LabVIEW>\examples\IMAQ\IMAQ High Level.llb file, where <LabVIEW> is the location to which LabVIEW is installed.

Low-Level

Use the low-level acquisition VIs for more advanced image acquisition applications, including ring acquisitions and acquisitions to onboard memory. The low-level VIs configure an acquisition, start an acquisition, retrieve the acquired images, and stop an acquisition. You can use these VIs in conjunction with the event VIs to construct advanced image acquisition applications.

Complete the following steps to perform a low-level acquisition:

  1. Call IMAQ Init to initialize the device and create an IMAQ Session.
  2. Configure the acquisition with IMAQ Configure List and IMAQ Configure Buffer. IMAQ Configure List configures a buffer list to be used in an acquisition. The buffer list contains a specific number of buffers that contain the acquired images. The buffers can be stored either in system memory or in onboard memory for devices with onboard memory.
  3. Call IMAQ Configure Buffer once for each buffer in the buffer list. The buffer contains the channel or port from which to acquire and the number of frames to skip before acquiring into the buffer.
  4. After configuring the buffer list and individual buffers, call IMAQ Start to start the acquisition asynchronously. IMAQ Start returns immediately after the acquisition has started.
  5. Access the acquired images using either IMAQ Get Buffer or IMAQ Extract Buffer. IMAQ Get Buffer returns acquired images from the buffer list and is normally used for snap and sequence acquisitions. IMAQ Get Buffer waits until the requested buffer has been acquired to return the image. You also can use this VI to return all images in the buffer list. IMAQ Get Buffer can retrieve images from a continuous acquisition only if the acquisition has been stopped.

    IMAQ Extract Buffer extracts a buffer from a continuous acquisition and allows for the examination of a buffer during acquisition. This VI removes the buffer from the acquisition. NI-IMAQ does not write new data into the buffer until this VI is called again. Use IMAQ Extract Buffer in ring acquisitions when you must process images during the acquisition. IMAQ Copy Acquired Buffer returns a copy of an acquired image. IMAQ Copy Acquired Buffer allows you to create a copy of any buffer at any time during the acquisition.
  6. After an acquisition, release the resources associated with the acquisition using IMAQ Close. IMAQ Close also stops the acquisition if one is in progress. If you want to stop the acquisition without releasing the resources (such as the image buffers), use IMAQ Stop.

Examples of the low-level acquisition VIs are included in the <LabVIEW>\examples\IMAQ\IMAQ Low Level.llb file, where <LabVIEW> is the location to which LabVIEW is installed.

Bayer Decoded Acquisition

Complete the following steps to perform a Bayer decoded acquisition:

  1. Call IMAQ Init to generate an IMAQ Session.
  2. Use the IMAQ property node to find the bits per pixel.
  3. Create an image with IMAQ Create using the image type from the property node.
  4. Acquire the image with IMAQ Snap.
  5. Call IMAQ Create Bayer LUT to create a lookup table based on the input gains.
    Note  To find the appropriate values for the gains, use the White Balancing Utility located at Start»All Programs»National Instruments»Vision»White Balancing Utility.
  6. Create an RGB image using IMAQ Create.
  7. Call IMAQ Bayer Color Decode to decode the color information from the raw image.

The following figure shows a block diagram for acquiring an IMAQ Bayer decoded image.