Acquiring From GigE Cameras
Acquiring From GigE Cameras
Acquiring From GigE Cameras
Overview
This tutorial continues the discussion in Part I regarding using GigE Vision cameras with Vision Acquisition Software. In this part, we will discuss the hardware and software requirements for
acquisition. Then we review using the LabVIEW API to first acquire images from the camera, control the camera settings, and then setup triggering of the camera.
To understand the basics of the GigE Vision standard, please read the Application Note:
Acquiring from GigE Vision Cameras with Vision Acquisition Software - Part I
Table of Contents
1. Hardware and Software Setup
2. Acquiring Images in MAX
3. Acquiring Images in LabVIEW
4. Understanding Camera Attributes
5. Programmatically Controlling Camera Settings
6. Triggering in GigE Vision
7. Caveats and Pitfalls
8. Related Links
1/5
www.ni.com
Figure 3. MAX automatically detects any GigE Vision camera on the same subnet
MAX will display any GigE Vision camera on the same subnet as the host. However, NI-IMAQdx allows you to acquire images from cameras on remote subnets too. You can discover cameras on
remote subnets by calling the appropriate function in the NI-IMAQdx API. For example, the C function IMAQdxDiscoverEthernetCameras() has a parameter to specify the subnet to discover
cameras on.
Once you are able to discover the camera in MAX, the next step is to acquire images from it. Select the camera from the sub tree to open it in the main window. Below are the various parts of the
Acquisition tab and their descriptions
2/5
www.ni.com
Video Mode: This attribute is only valid for IEEE 1394 cameras. It is grayed out for GigE Vision cameras.
Pixel Format: Displays a list of available pixel format. Typical formats are Mono8, Mono16 and YUV422Packed.
Region of Interest: Specifies the left and lop offsets and the width and height of the acquisition window.
Timeout: Sets the number of milliseconds the driver will wait for an acquisition to complete before returning a timeout error.
Packet Size: Specifies the number of bytes transferred in each data packet. This number must be less than the maximum packet size allowed by the network card (1500 if Jumbo packets are
disabled and 9014 if Jumbo packets are enabled).
Once you have set the acquisition parameters correctly, click the Snap to acquire one image or click the Grab to acquire images continuously.
3/5
www.ni.com
<Length>2</Length>
<AccessMode>RW</AccessMode>
<pPort>Device</pPort>
<Sign Unsigned </Sign>
<Endianess>BigEndian</Endianess>
</IntReg>
Figure 7. Snippet of an XML file describing the gain attribute
Figure 7 shows a very simple example of the gain attribute being described in an XML file. Upon parsing this snippet of XML code, NI-IMAQdx determines the following:
The feature name is Gain.
It has a minimum and maximum value of 0 and 128 respectively and has a minimum increment of 1.
The gain value is represented in logarithmic form.
The current gain value is stored in a register with address 0x0815 in BigEndian Unsigned form and is 2 bytes long.
The driver has both read and write access to this register.
Every such attribute supported by the camera will have a section of code in the XML file that defines the attribute parameters. You can examine the XML file manually by opening it from the
<Program Files>\National Instruments\NI-IMAQdx\Data\XML directory. Note: The above example is a very simplistic representation of an attribute and is provided as an academic exercise. Typical
XML files are far more complicated and involve many cross references.
4/5
www.ni.com
In GenICam, selecting trigger modes works just like setting camera attributes. In fact, trigger modes are attributes in GenICam. You can use the same API discussed in the previous section to set
trigger modes. The GenICam Standard Features Naming Convention defines several trigger control features that let you customize the behavior of your triggered action. While camera
manufacturers are not required to implement all triggering modes, the most commonly used modes are described below.
AquisitionStart: Trigger starts the acquisition on the camera
AcquisitionActive: Camera acquires images as long as the trigger is active
FrameStart: Camera captures one image for each trigger
LineStart: Camera captures one line for each trigger (used in line scan cameras)
ExposureStart: Trigger begins exposure of one frame (or line)
ExposureActive: Frame (or line) is exposed as long as the trigger is active
8. Related Links
Acquiring from GigE Vision cameras using Vision Acquisition Software - Part I
European Machine Vision Association: The GenICam standard
American Imaging Association: The GigE Vision standard
List of GigE Vision Cameras on NI Camera Advisor
Troubleshooting GigE Vision Cameras with Vision Acquisition Software
5/5
www.ni.com