Page 3 - Important Information; Warranty; Patents; WARNING REGARDING USE OF NATIONAL INSTRUMENTS PRODUCTS
Important Information Warranty The media on which you receive National Instruments software are warranted not to fail to execute programming instructions, due to defects in materials and workmanship, for a period of 90 days from date of shipment, as evidenced by receipts or other documentation. Nati...
Page 4 - Conventions; File»Page Setup»Options
Conventions The following conventions are used in this manual: » The » symbol leads you through nested menu items and dialog box options to a final action. The sequence File»Page Setup»Options directs you to pull down the File menu, select the Page Setup item, and select Options from the last dialog...
Page 5 - Contents
© National Instruments Corporation v NI-IMAQdx User Manual Contents Chapter 1Introduction to NI-IMAQdx About the NI-IMAQdx Software ................................................................................... 1-1 Application Development Environments ..............................................
Page 7 - Glossary
Contents © National Instruments Corporation vii NI-IMAQdx User Manual Chapter 5Using NI-IMAQdx in C and .NET Using NI-IMAQdx for C ............................................................................................... 5-1Using NI-IMAQdx for Microsoft Visual Studio .NET.........................
Page 8 - Introduction to NI-IMAQdx; About the NI-IMAQdx Software
© National Instruments Corporation 1-1 NI-IMAQdx User Manual 1 Introduction to NI-IMAQdx This chapter describes the NI-IMAQdx driver software, lists the supported application development environments (ADEs), describes the fundamentals of creating applications using NI-IMAQdx, describes the files use...
Page 9 - Application Development Environments; Configuring Your Camera; Help»Help Topics»NI-IMAQdx
Chapter 1 Introduction to NI-IMAQdx NI-IMAQdx User Manual 1-2 ni.com Application Development Environments This release of NI-IMAQdx supports the following ADEs for Windows Vista/XP/2000: • LabVIEW version 7.1.1 and later • LabVIEW Real-Time Module version 7.1.1 and later • LabWindows ™ /CVI ™ versio...
Page 10 - Fundamentals of Building Applications with NI-IMAQdx; Architecture
Chapter 1 Introduction to NI-IMAQdx © National Instruments Corporation 1-3 NI-IMAQdx User Manual Fundamentals of Building Applications with NI-IMAQdx Architecture Figure 1-1 illustrates the NI-IMAQdx driver architecture. Figure 1-1. NI-IMAQdx Architecture The architecture uses a hardware abstraction...
Page 11 - Example Programs; Windows»Show VI Info; Help»Find Examples
Chapter 1 Introduction to NI-IMAQdx NI-IMAQdx User Manual 1-4 ni.com NI-IMAQdx Libraries The NI-IMAQdx function libraries are dynamic link libraries (DLLs), which means that NI-IMAQdx routines are not linked into the executable files of applications. Only the information about the NI-IMAQdx routines...
Page 12 - Introduction
© National Instruments Corporation 2-1 NI-IMAQdx User Manual 2 Basic Acquisition with NI-IMAQdx This chapter contains an overview of the NI-IMAQdx library, a description of the acquisition flow of NI-IMAQdx, and generic programming examples. The chapter also contains flowcharts of high-level and low...
Page 13 - Acquisition Flow; Opening a Camera
Chapter 2 Basic Acquisition with NI-IMAQdx NI-IMAQdx User Manual 2-2 ni.com Both high-level and low-level functions support snap, grab, sequence, and triggered acquisitions. Using high-level functions, you can write programs quickly without having to learn the details of the low-level API and driver...
Page 14 - Camera Name
Chapter 2 Basic Acquisition with NI-IMAQdx © National Instruments Corporation 2-3 NI-IMAQdx User Manual Camera Name NI-IMAQdx references all camera sessions by a name. The driver creates default names for each camera in your system in the order that the cameras are connected. The names observe the c...
Page 15 - Camera Control Mode; Configure the Acquisition
Chapter 2 Basic Acquisition with NI-IMAQdx NI-IMAQdx User Manual 2-4 ni.com When you open a camera session with the Camera Open function, the camera with the unique serial number described by the interface file cam n.iid opens, where n is the reference to the camera. If the camera is not present and...
Page 16 - Number of Buffers; Region of Interest
Chapter 2 Basic Acquisition with NI-IMAQdx © National Instruments Corporation 2-5 NI-IMAQdx User Manual acquisition. National Instruments recommends one-shot acquisition for applications that do not require real-time acquisition or processing. Use a continuous acquisition to start an acquisition, co...
Page 17 - Pixel Format; Acquisition
Chapter 2 Basic Acquisition with NI-IMAQdx NI-IMAQdx User Manual 2-6 ni.com transferred from the camera to system memory. In all video modes, the ROI specifies the amount of data decoded by the driver while acquiring into a user buffer. By default, the driver transfers the entire image. Specify a sm...
Page 18 - Buffer Number Mode
Chapter 2 Basic Acquisition with NI-IMAQdx © National Instruments Corporation 2-7 NI-IMAQdx User Manual Buffer Number Mode Specify one of the following options for the buffer number mode. • Buffer Number—Gets the exact buffer number specified in the Buffer Number parameter. • Last—Gets the most rece...
Page 19 - Timeouts; Raw Camera Output
Chapter 2 Basic Acquisition with NI-IMAQdx NI-IMAQdx User Manual 2-8 ni.com The default overwrite mode for all types of acquisition is to get the newest valid buffer. This option, which National Instruments recommends for most applications, enables you to process the most recent image. If you need t...
Page 20 - Programming Examples; High-Level Function Examples
Chapter 2 Basic Acquisition with NI-IMAQdx © National Instruments Corporation 2-9 NI-IMAQdx User Manual Decoding images requires CPU resources. However, many of the decoding algorithms have been optimized in the driver. If you do not want decoded image data, you can use NI-IMAQdx to get a copy of th...
Page 21 - Grab
Chapter 2 Basic Acquisition with NI-IMAQdx NI-IMAQdx User Manual 2-10 ni.com Note If you do not have a valid session, a temporary session is created using cam0 . Then, the snap acquires the next incoming image into a user buffer. After the image is acquired, the program calls image processing and an...
Page 22 - Sequence; Low-Level Function Examples
Chapter 2 Basic Acquisition with NI-IMAQdx © National Instruments Corporation 2-11 NI-IMAQdx User Manual Calling the Configure Grab function opens a session for a grab acquisition. During acquisition, each successive grab copies the last acquired internal buffer into a user buffer where you can proc...
Page 23 - Snap
Chapter 2 Basic Acquisition with NI-IMAQdx NI-IMAQdx User Manual 2-12 ni.com Snap The low-level snap examples set up a one-shot, single-image acquisition and start the acquisition. The program acquires an image and processes it. Finally, the program stops the acquisition, unconfigures the acquisitio...
Page 26 - Camera Attributes; Set Attribute; Get; Attribute Name; Enumerate Attributes
© National Instruments Corporation 3-1 NI-IMAQdx User Manual 3 Advanced Programming with NI-IMAQdx This chapter contains information about setting camera attributes, broadcasting acquired images to multiple machines, using scale to define the size of transferred images, and triggering. Camera Attrib...
Page 27 - Get Attribute Type; Attribute Value; Attribute Type; Value Type
Chapter 3 Advanced Programming with NI-IMAQdx NI-IMAQdx User Manual 3-2 ni.com Attribute Type The attribute type determines how a camera attribute is stored in the driver and the camera. Use the Get Attribute Type function to query the type of a given attribute. Each attribute is represented as one ...
Page 28 - Attribute Access
Chapter 3 Advanced Programming with NI-IMAQdx © National Instruments Corporation 3-3 NI-IMAQdx User Manual The following value types are compatible for any given attribute type. The bolded compatible value type indicates the native value type. For example, use a 32-bit unsigned integer value type wh...
Page 30 - Implementation
Chapter 3 Advanced Programming with NI-IMAQdx © National Instruments Corporation 3-5 NI-IMAQdx User Manual Figure 3-1. One Camera Broadcasting to Multiple Host Computers The camera broadcasts video data on the camera bus and all the connected host computers receive the same image data. In this scena...
Page 31 - General; Scalable Image Size
Chapter 3 Advanced Programming with NI-IMAQdx NI-IMAQdx User Manual 3-6 ni.com For GigE Vision cameras, you can configure the camera to broadcast or multicast image data to all nodes on the network. Broadcast is not routable, and everyone on the same network sees the data, even if they are not liste...
Page 32 - Trigger Modes; Trigger Modes for IIDC Cameras
Chapter 3 Advanced Programming with NI-IMAQdx © National Instruments Corporation 3-7 NI-IMAQdx User Manual The Increment values are camera-specific. Refer to the camera documentation or query the Increment attributes for width and height to obtain the actual values. Figure 3-2. Partial Image Size Fo...
Page 33 - TriggerParameter; Trigger Mode 0; Trigger Mode 1
Chapter 3 Advanced Programming with NI-IMAQdx NI-IMAQdx User Manual 3-8 ni.com • TriggerParameter —Certain trigger modes require an additional parameter. Refer to the following sections to see if the optional parameter is required. Trigger Mode 0 With trigger mode 0, the camera starts frame integrat...
Page 34 - Trigger Mode 2; Trigger Mode 3
Chapter 3 Advanced Programming with NI-IMAQdx © National Instruments Corporation 3-9 NI-IMAQdx User Manual Trigger Mode 2 With trigger mode 2, the camera starts frame integration when the external trigger input changes to an active value. The same frame is exposed for multiple triggers. The number o...
Page 35 - Trigger Mode 4; Trigger Mode 5
Chapter 3 Advanced Programming with NI-IMAQdx NI-IMAQdx User Manual 3-10 ni.com Trigger Mode 4 With trigger mode 4, the camera starts frame integration when the external trigger input changes to an active value. Multiple frames are exposed before the camera transfers the image to the host computer. ...
Page 36 - Trigger Modes for GigE Vision Cameras; TriggerSelector
Chapter 3 Advanced Programming with NI-IMAQdx © National Instruments Corporation 3-11 NI-IMAQdx User Manual Trigger Modes for GigE Vision Cameras Note All triggering modes and parameters for GigE Vision cameras are subject to camera vendor implementation. Refer to your camera documentation for trigg...
Page 37 - Using NI-IMAQdx in LabVIEW; Vision and Motion; Location of the NI-IMAQdx VIs; Functions
© National Instruments Corporation 4-1 NI-IMAQdx User Manual 4 Using NI-IMAQdx in LabVIEW This chapter describes how to use NI-IMAQdx VIs in LabVIEW. Introduction The NI-IMAQdx VI library—part of the NI-IMAQdx software—is a group of virtual instruments (VIs) that enable you to use LabVIEW with your ...
Page 38 - Vision and Motion»NI-IMAQdx»NI-IMAQdx Low Level; Common VI Parameters; IMAQdx Session; Image In
Chapter 4 Using NI-IMAQdx in LabVIEW © National Instruments Corporation 4-2 NI-IMAQdx User Manual The Vision and Motion»NI-IMAQdx»NI-IMAQdx Low Level palette contains VIs for more advanced applications. Refer to the NI-IMAQdx VI Reference Help for more information about using these VIs. Common VI Pa...
Page 39 - Acquisition VIs
Chapter 4 Using NI-IMAQdx in LabVIEW NI-IMAQdx User Manual 4-3 ni.com Acquisition VIs Two types of acquisition VIs are available in LabVIEW: high-level and low-level. High-Level Use the high-level acquisition VIs for basic image acquisition applications. VIs are included for snap, grab, and sequence...
Page 42 - Image Array In
Chapter 4 Using NI-IMAQdx in LabVIEW © National Instruments Corporation 4-6 NI-IMAQdx User Manual Figure 4-4 shows a simplified block diagram for using IMAQdx Configure Grab and IMAQdx Grab. Figure 4-4. Acquiring Images Using Grab Sequence Use the IMAQdx Sequence VI for sequence applications. IMAQdx...
Page 43 - Image Display; Vision; Image Out; Vision and Motion»
Chapter 4 Using NI-IMAQdx in LabVIEW NI-IMAQdx User Manual 4-7 ni.com Image Display Many image acquisition applications require that one or more images be displayed. You have several options for displaying images in LabVIEW. You can display an image directly on the front panel using an Image Display...
Page 44 - Vision and Motion»Vision Utilities»IMAQ RT
Chapter 4 Using NI-IMAQdx in LabVIEW © National Instruments Corporation 4-8 NI-IMAQdx User Manual If you have LabVIEW RT, you can use IMAQ RT Video Out, located at Vision and Motion»Vision Utilities»IMAQ RT , to display an image on the monitor connected to your RT device. Use IMAQ Video Out Display ...
Page 45 - Error Handling; error in; error out
Chapter 4 Using NI-IMAQdx in LabVIEW NI-IMAQdx User Manual 4-9 ni.com Figure 4-9 shows how to set camera attributes with the property nodes in NI-IMAQdx. Figure 4-9. Setting Camera Attributes with Property Nodes Error Handling Every NI-IMAQdx VI contains an error in input cluster and an error out ou...
Page 46 - Functions»
Chapter 4 Using NI-IMAQdx in LabVIEW © National Instruments Corporation 4-10 NI-IMAQdx User Manual You can use the Simple Error Handler VI, located on the Functions» Dialog & User Interface palette, to check for errors that occur while executing a VI. If you wire an error cluster to the Simple E...
Page 47 - Using NI-IMAQdx for C
© National Instruments Corporation 5-1 NI-IMAQdx User Manual 5 Using NI-IMAQdx in C and .NET This chapter briefly describes how to use NI-IMAQdx functions in Microsoft Visual C and Microsoft Visual Studio .NET. Using NI-IMAQdx for C This section outlines the process for developing NI-IMAQdx applicat...
Page 48 - Using NI-IMAQdx for Microsoft Visual Studio .NET; Creating a New .NET Application; Project»Add Reference
Chapter 5 Using NI-IMAQdx in C and .NET © National Instruments Corporation 5-2 NI-IMAQdx User Manual You can use the additional Image functions installed with NI-IMAQdx. These functions use the NI Vision memory management feature, which automatically allocates the memory for your image. To use these...
Page 49 - Tools»Add/Remove Toolbox Items; .NET Framework Components
Chapter 5 Using NI-IMAQdx in C and .NET NI-IMAQdx User Manual 5-3 ni.com 4. Select Tools»Add/Remove Toolbox Items . 5. Under the .NET Framework Components tab, select the CWIMAQViewer control. When the Viewer control is in the toolbox, you can add it to your forms by clicking on the tool and drawing...
Page 50 - Register-Level Programming
© National Instruments Corporation A-1 NI-IMAQdx User Manual A Register-Level Programming This appendix explains how to access and program register locations using the NI-IMAQdx software, and discusses the caveats involved in programming registers. Introduction All cameras communicate to the host co...
Page 52 - Usage; Basic Example
Appendix A Register-Level Programming © National Instruments Corporation A-3 NI-IMAQdx User Manual The NI-IMAQdx software provides the following register-level primitives: • Read Register—Reads 32-bits of data from a specified memory location • Write Register—Writes 32-bits of data to a specified me...
Page 53 - Advanced Example; Caveats
Appendix A Register-Level Programming NI-IMAQdx User Manual A-4 ni.com Advanced Example The advanced feature described in this example is specific to Basler IEEE 1394 cameras. The advanced feature replaces the live video feed with a static test pattern. According to the user documentation for the Ba...
Page 54 - Byte Array; Invalid Memory Location
Appendix A Register-Level Programming © National Instruments Corporation A-5 NI-IMAQdx User Manual endian data. To correct for this discrepancy, NI-IMAQdx byte-swaps every quadlet that is read or written with low-level register primitives. Byte Array Many cameras allow register-level access to more ...
Page 55 - Training and Certification
© National Instruments Corporation B-1 NI-IMAQdx User Manual B Technical Support and Professional Services Visit the following sections of the National Instruments Web site at ni.com for technical support and professional services: • Support —Online technical support resources at ni.com/support incl...
Page 62 - Index
© National Instruments Corporation I-1 NI-IMAQdx User Manual Index A advanced programming examples grab using low-level functions, 2-13sequence using low-level functions, 2-14snap using low-level functions, 2-12 application development, 1-3 C, 5-1environments, 1-2LabVIEW, 4-1LabVIEW Real-Time Module...