National Instruments NI-IMAQ User Manual
National Instruments NI-IMAQ User Manual

National Instruments NI-IMAQ User Manual

For ieee-1394 cameras
Hide thumbs Also See for NI-IMAQ:
Table of Contents

Advertisement

Quick Links

IMAQ
NI-IMAQ
for IEEE-1394
Cameras User Manual
Image Acquisition Software
NI-IMAQ for IEEE-1394 Cameras User Manual
March 2001 Edition
Part Number 370362A-01

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the NI-IMAQ and is the answer not in the manual?

Questions and answers

Summary of Contents for National Instruments NI-IMAQ

  • Page 1 IMAQ ™ ™ NI-IMAQ for IEEE-1394 Cameras User Manual Image Acquisition Software NI-IMAQ for IEEE-1394 Cameras User Manual March 2001 Edition Part Number 370362A-01...
  • Page 2 Singapore 2265886, Spain 91 640 0085, Sweden 08 587 895 00, Switzerland 056 200 51 51, Taiwan 02 2528 7227, United Kingdom 01635 523545 For further support information, see the Technical Support Resources appendix. To comment on the documentation, send e-mail to techpubs@ni.com Copyright © 2001 National Instruments Corporation. All rights reserved.
  • Page 3: Important Information

    The reader should consult National Instruments if errors are suspected. In no event shall National Instruments be liable for any damages arising out of or related to this document or the information contained in it.
  • Page 4 Italic text in this font denotes text that is a placeholder for a word or value monospace italic that you must supply. NI-IMAQ for 1394 NI-IMAQ for 1394 represents the NI-IMAQ for IEEE-1394 Cameras software package.
  • Page 5: Table Of Contents

    Chapter 1 Introduction to NI-IMAQ for IEEE-1394 Cameras About the NI-IMAQ Software ...1-1 Application Development Environments ...1-2 Configuring Your IEEE-1394 Camera...1-2 Fundamentals of Building Applications with NI-IMAQ for 1394 ...1-3 Architecture ...1-3 The NI-IMAQ Libraries ...1-4 Creating an Application...1-4 Sample Programs...1-5...
  • Page 6 Programming with NI-IMAQ for 1394 VIs Introduction ... 4-1 Location of NI-IMAQ for 1394 Examples... 4-2 Location of the NI-IMAQ for 1394 VIs ... 4-2 Common NI-IMAQ for 1394 VI Parameters ... 4-3 Buffer Management... 4-4 NI-IMAQ for 1394 Acquisition Types... 4-5 Snap...
  • Page 7: Introduction To Ni-Imaq For Ieee-1394 Cameras

    The cameras may operate at various resolutions and frame rates, depending on camera capabilities. NI-IMAQ for 1394 uses a WDM driver to directly access the 1394 interface, so that NI-IMAQ can control all of the available modes of the digital camera. © National Instruments Corporation...
  • Page 8: Application Development Environments

    Windows Me/98: • • • • Although NI-IMAQ for 1394 has been tested and found to work with these ADEs, Note other ADEs may also work. Configuring Your IEEE-1394 Camera You can use National Instruments Measurement & Automation Explorer (MAX) to configure your IEEE-1394 camera.
  • Page 9: Fundamentals Of Building Applications With Ni-Imaq For 1394

    Fundamentals of Building Applications with NI-IMAQ for 1394 Architecture A block diagram of the NI-IMAQ for 1394 architecture shown in Figure 1-1 illustrates the low- and mid-level architecture for IMAQ devices. © National Instruments Corporation Chapter 1 Introduction to NI-IMAQ for IEEE-1394 Cameras...
  • Page 10: The Ni-Imaq Libraries

    NI-IMAQ for IEEE-1394 Cameras User Manual Include the header file in all C source files that use niimaq1394.h NI-IMAQ functions. Add this file to the top of your source files. Add the import library to your project. Some niimaq1394.lib environments allow you to add import libraries simply by inserting them into your list of project files.
  • Page 11: Sample Programs

    • Sample Programs Please refer to the directory for the latest details on NI-IMAQ for 1394 sample programs. These programs are installed in the installation folder, if you elected to install the sample files. © National Instruments Corporation Chapter 1 When compiling, indicate where the compiler can find the NI-IMAQ header files and shared libraries.
  • Page 12: Software Overview

    Software Overview This chapter describes the classes of NI-IMAQ for 1394 functions and briefly describes each function. Introduction NI-IMAQ functions are grouped according to the following classes: • • • The generic and high-level functions appear within each function class in the logical order you might need to use them.
  • Page 13: High-Level Functions

    NI-IMAQ for IEEE-1394 Cameras User Manual Performs a single frame acquisition in an image buffer, which is allocated using IMAQ Vision memory management.
  • Page 14: Sequence Functions

    Configures an acquisition to start based on an external trigger. Gets the current session status. Configures the acquisition session mode (continuous or one-shot). Starts acquisition synchronously or asynchronously. NI-IMAQ for IEEE-1394 Cameras User Manual Software Overview...
  • Page 15: Attribute Functions

    Chapter 2 Software Overview imaq1394StopAcquisition imaq1394GetBuffer imaq1394GetImage imaq1394InstallCallback Attribute Functions Use attribute functions to examine and change NI-IMAQ or camera attributes. imaq1394GetAttribute imaq1394SetAttribute imaq1394AttributeInquiry imaq1394GetVideoModes imaq1394GetFeatures NI-IMAQ for IEEE-1394 Cameras User Manual Stops an asynchronous acquisition or synchronous continuous acquisition immediately.
  • Page 16: Utility Functions

    Plots a buffer to a window given a handle to a device context. Saves a buffer of a session to disk in bitmap, TIFF, or PNG format. Returns a null-terminated string describing the error code. NI-IMAQ for IEEE-1394 Cameras User Manual Software Overview...
  • Page 17: Programming With Ni-Imaq For 1394

    Note The high-level functions call low-level functions and use certain attributes that are listed in the high-level function description in the NI-IMAQ for 1394 Function Reference online help. Changing the value of these attributes while using low-level functions will affect the operation of the high-level functions.
  • Page 18: Low-Level Functions

    Camera name information is stored in an interface ( NI-IMAQ for 1394 specifies all interfaces by a name. By default, the system creates default names for the number of cameras in your system. These names observe the convention shown in Table 3-1.
  • Page 19: Camera Attributes

    Before you can acquire image data successfully, you must open a camera with the requires a camera name and returns a handle to this interface. NI-IMAQ for 1394 then uses this handle to reference this camera when using other NI-IMAQ functions.
  • Page 20: Scalable Image Size

    IMAQ Vision. When you use C or C++ with NI-IMAQ for 1394 functions, you must know the size of the image for the selected format and mode to allocate enough memory to contain the image.
  • Page 21: Introductory Programming Examples

    Introductory Programming Examples This section introduces some examples for performing the different types of image acquisition. The error codes returned by NI-IMAQ are not included in the examples. Always Note check the return code for errors in your program. If you have IMAQ Vision installed on your computer, you can take advantage of the additional Image functions installed with NI-IMAQ for 1394.
  • Page 22: High-Level Grab Functions

    MAX. The sample then calls a process function to analyze the image. When the program is finished, it calls instructs NI-IMAQ to free all of the resources associated with this camera, which releases the session. High-Level Grab Functions A grab is a continuous high-speed acquisition of data to a single buffer in host memory.
  • Page 23 . The example performs multiple grabs until an appropriate imaq1394Grab imaq1394Grab Programming with NI-IMAQ for 1394 opens configures the camera for a and imaq1394GrabImage imaq1394Grab (Loop) closes the camera and session. function. . When the acquisition is imaq1394Close NI-IMAQ for IEEE-1394 Cameras User Manual...
  • Page 24: High-Level Sequence Functions

    The skip count is the number of frames to skip prior to acquiring the next image. The acquisition is started at setup time and the setup call is synchronous. NI-IMAQ for IEEE-1394 Cameras User Manual imaq1394SetupSequence and specify both the buffer list used for...
  • Page 25: Advanced Programming Examples

    Performing a Sequence Acquisition Using Low-Level Functions sequence acquisition using low-level calls. The example sets up a sequence acquisition to multiple buffers allocated by NI-IMAQ. As described in the low-level snap example, the program retrieves the acquisition window size of the selected camera. It creates a buffer list to describe the acquisition buffers.
  • Page 26: Performing An Asynchronous Snap Using Low-Level Functions

    Because the callback function is called in a different thread than the main program, Note you should make sure that all of your processing is thread-safe. NI-IMAQ for IEEE-1394 Cameras User Manual function and starts the acquisition with the function. When the buffer is ready, the function.
  • Page 27: Programming With Ni-Imaq For 1394 Vis

    Programming with NI-IMAQ for 1394 VIs This chapter describes how to use the NI-IMAQ 1394 VIs in LabVIEW. Introduction The NI-IMAQ for IEEE-1394 Cameras VI Library, a series of virtual instruments (VIs) for using LabVIEW with your IMAQ 1394 device, is included with your NI-IMAQ for 1394 software.
  • Page 28: Location Of Ni-Imaq For 1394 Examples

    Windows»Show VI Info for a text description of the example. Location of the NI-IMAQ for 1394 VIs You can find the NI-IMAQ VIs in the Functions palette from your LabVIEW block diagram. Select the Motion and Vision palette and then select the Image Acquisition palette, as shown in Figure 4-1.
  • Page 29: Common Ni-Imaq For 1394 Vi Parameters

    IMAQ1394 Session is a unique identifier that specifies the Interface file used for the acquisition. It is produced by the IMAQ1394 Init VI and used as an input to all other NI-IMAQ VIs. The NI-IMAQ for 1394 VIs use IMAQ1394 Session Out, which is identical to IMAQ Session, to simplify dataflow programming.
  • Page 30: Buffer Management

    Chapter 4 Programming with NI-IMAQ for 1394 VIs Buffer Management IMAQ Create and IMAQ Dispose manage image buffers in LabVIEW. IMAQ Create, shown in Figure 4-2, allocates an image buffer. Image Name is a label for the buffer created. Each buffer must have a unique name.
  • Page 31: Ni-Imaq For 1394 Acquisition Types

    NI-IMAQ for 1394 Acquisition Types Three NI-IMAQ image acquisition types are available in LabVIEW—snap, grab, and sequence. The following sections describe each acquisition type and give examples. Snap snap mode to acquire a single frame or field to a buffer. When you invoke a snap, it initializes the device and acquires the next incoming video frame to a buffer.
  • Page 32: Sequence

    Chapter 4 Programming with NI-IMAQ for 1394 VIs Figure 4-5 shows a simplified block diagram for using IMAQ1394 Grab Setup and IMAQ1394 Grab Acquire. Sequence A sequence initiates a variable-length and variable-delay transfer to multiple buffers. Use a sequence for applications that process multiple images.
  • Page 33: Acquisition Vis

    Call IMAQ1394 Init to initialize the board and create an IMAQ1394 Session. Call IMAQ1394 Configure Occurrence if you want to implement an asynchronous acquisition. Call IMAQ1394 Start Acquisition. Programming with NI-IMAQ for 1394 VIs section of this chapter. You can file. NI-IMAQ for IEEE-1394 Cameras User Manual...
  • Page 34: Triggering

    Chapter 4 Programming with NI-IMAQ for 1394 VIs Examples of the low-level acquisition VIs are included in examples/imaq/IMAQ1394examples.llb Triggering Often you may need to link or coordinate a vision action or function with events external to the computer, such as receiving a strobe pulse for lighting or a pulse from an infrared detector that indicates the position of an item on an assembly line.
  • Page 35 10-bit images, and 4,095 for 12-bit images. Invert the y-axis. You might also need to change the ranges of the x- and y-axes to match the width and height of the image. Programming with NI-IMAQ for 1394 VIs NI-IMAQ for IEEE-1394 Cameras User Manual...
  • Page 36 Chapter 4 Programming with NI-IMAQ for 1394 VIs Your intensity graph now should appear similar to the image shown in Figure 4-9. For more information on the Intensity Graph, consult your LabVIEW documentation Use the IMAQ ImageToArray VI to copy an image from an image buffer into a LabVIEW array.
  • Page 37: Camera Attributes

    Camera Attributes Camera attributes allow you to control camera-specific features such as brightness and shutter speed directly from NI-IMAQ for 1394. You can also set camera attributes through the feature tab in MAX. All of the configured parameters for a camera are stored in a camera ( file is linked to a specific camera.
  • Page 38: Error Handling

    Programming with NI-IMAQ for 1394 VIs Error Handling Every NI-IMAQ for 1394 VI contains an error in input cluster and an error out output cluster, as shown in Figure 4-12. The clusters contain a Boolean value that indicates whether an error occurred, the code for the error, and the source or the name of the VI that returned the error.
  • Page 39: Error Code Format

    Error Code Format Error format for all NI-IMAQ for 1394 VIs is the same, as follows: error in (no error) is a cluster that describes the error status before this VI executes. If error in indicates that an error occurred before this VI was called, this VI may choose not to execute its function, but just pass the error through to its error out cluster.
  • Page 40 Chapter 4 Programming with NI-IMAQ for 1394 VIs NI-IMAQ for IEEE-1394 Cameras User Manual code is the number identifying an error or warning. If status is TRUE, code is a non-zero error code. If status is FALSE, code can be zero or a warning code. Use the error handler VIs to look up the meaning of this code and to display the corresponding error message.
  • Page 41: System Integration

    Technical Support Resources Web Support National Instruments Web support is your first stop for help in solving installation, configuration, and application problems and questions. Online problem-solving and diagnostic resources include frequently asked questions, knowledge bases, product-specific troubleshooting wizards, manuals, drivers, software updates, and more. Web support is available...
  • Page 42: Worldwide Support

    Appendix A Technical Support Resources Worldwide Support National Instruments has offices located around the world to help address your support needs. You can access our branch office Web sites from the Worldwide Offices section of up-to-date contact information, support phone numbers, e-mail addresses, and current events.
  • Page 43 Temporary storage for acquired data. cache High-speed processor memory that buffers commonly used instructions or data to increase processing throughput. chroma The color information in a video signal. © National Instruments Corporation NI-IMAQ for IEEE-1394 Cameras User Manual...
  • Page 44 Direct memory access. A method by which data can be transferred between computer memory and a device or memory on the bus while the processor does something else. DMA is the fastest method of transferring data to/from computer memory. NI-IMAQ for IEEE-1394 Cameras User Manual ni.com...
  • Page 45 Represents the dominant color of a pixel. The hue function is a continuous function that covers all the possible colors generated using the R, G, and B color spectrum. See also RGB. Hertz. Frequency in units of 1/second. © National Instruments Corporation NI-IMAQ for IEEE-1394 Cameras User Manual Glossary...
  • Page 46 IEEE Institute of Electrical and Electronics Engineers. instrument driver A set of high-level software functions, such as NI-IMAQ, that control specific plug-in computer boards. Instrument drivers are available in several forms, ranging from a function callable from a programming language to a virtual instrument (VI) in LabVIEW.
  • Page 47 Multiplexer. A switching device with multiple inputs that selectively connects one of its inputs to its output. NI-IMAQ Driver software for National Instruments IMAQ hardware. noninterlaced A video frame where all the lines are scanned sequentially, instead of divided into two frames as in an interlaced video frame.
  • Page 48 Points. Random-access memory. real time A property of an event or system in which data is processed as it is acquired instead of being accumulated and processed at a later time. NI-IMAQ for IEEE-1394 Cameras User Manual ni.com...
  • Page 49 Any event that causes or starts some form of data capture. UV plane See YUV. © National Instruments Corporation × . This image has n pixels NI-IMAQ for IEEE-1394 Cameras User Manual Glossary...
  • Page 50 A representation of a color image used for the coding of NTSC or PAL video signals. The luma information is called Y, while the chroma information is represented by two components, U and V representing the coordinates in a color plane. NI-IMAQ for IEEE-1394 Cameras User Manual ni.com...
  • Page 51 2-3 snap functions, 2-2 trigger functions, 2-3 image display, 4-8 to 4-11 introductory examples high-level grab functions, 3-6, 3-7 high-level sequence functions, 3-8 high-level snap functions, 3-5, 3-6 introductory programming examples, 3-5 to 3-8 NI-IMAQ for IEEE-1394 Cameras User Manual...
  • Page 52 NI-IMAQ for 1394 VIs, 4-4 buffer management, 4-4 examples, 4-2 introduction, 4-1 location, 4-2 parameters, 4-3 NI-IMAQ for IEEE-1394 Cameras User Manual scalable image size, 3-4 sequence functions, 2-3 snap functions, 2-2 system integration, by National Instruments, B-1 technical support resources, B-1...

Table of Contents