National Instruments NI-IMAQ User Manual

Other manuals for NI-IMAQ: User Manual
Manual is about: Image Acquisition Software

Summary of NI-IMAQ

  • Page 1

    Imaq ni-imaq ™ user manual image acquisition software ni-imaq user manual june 1998 edition part number 3 71443a-01 ™ um.Book page 1 monday, july 13, 1998 9:49 am.

  • Page 2

    Internet support e-mail: support@natinst.Com ftp site: ftp.Natinst.Com web address: http://www.Natinst.Com bulletin board support bbs united states: 512 794 5422 bbs united kingdom: 01635 551422 bbs france: 01 48 65 15 59 fax-on-demand support 512 418 1111 telephone support (usa) tel: 512 795 8248 f...

  • Page 3: Important Information

    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: Contents

    © national instruments corporation v ni-imaq user manual contents about this manual how to use the ni-imaq manual set ..........................................................................Ix organization of this manual ................................................................................

  • Page 5: Chapter 3

    Contents ni-imaq user manual vi © national instruments corporation chapter 3 programming with ni-imaq introduction ................................................................................................................... 3-1 high-level functions ...............................................

  • Page 6: Figures

    Contents © national instruments corporation vii ni-imaq user manual figures figure 3-1. Ni-imaq status signals .......................................................................3-6 figure 3-2. Snap programming flowchart...............................................................3-7 figure 3-...

  • Page 7: About This Manual

    © national instruments corporation ix ni-imaq user manual about this manual ni-imaq software is a powerful application programming interface (api) between your image acquisition application and the national instruments image acquisition (imaq) devices. This manual explains how to use your ni-imaq so...

  • Page 8

    About this manual ni-imaq user manual x © national instruments corporation • appendix b, customer communication , contains forms you can use to request help from national instruments or to comment on our products and manuals. • the glossary contains an alphabetical list and description of terms used...

  • Page 9: Related Documentation

    About this manual © national instruments corporation xi ni-imaq user manual national instruments documentation the ni-imaq user manual is one piece of the documentation set for your system. You could have any of several types of documents, depending on the hardware and software in your system. Use t...

  • Page 10: Introduction to Ni-Imaq

    © national instruments corporation 1-1 ni-imaq user manual 1 introduction to ni-imaq this chapter describes the ni-imaq software and lists the application development environments compatible with ni-imaq, describes the fundamentals of creating ni-imaq applications for windows 95 and windows nt, desc...

  • Page 11: The Ni-Imaq Libraries

    Chapter 1 introduction to ni-imaq ni-imaq user manual 1-2 © national instruments corporation application development environments this release of ni-imaq supports the following application development environments (ades) for windows 95 and windows nt: • labview version 4.X and higher • labwindows/cv...

  • Page 12: Creating An Application

    Chapter 1 introduction to ni-imaq © national instruments corporation 1-3 ni-imaq user manual creating an application this section outlines the process for developing ni-imaq applications using c for windows 95 and windows nt. Detailed instructions on creating project and source files are not include...

  • Page 13: Sample Programs

    Chapter 1 introduction to ni-imaq ni-imaq user manual 1-4 © national instruments corporation sample programs please refer to the readme.Txt file located in your target installation directory for the latest details on ni-imaq sample programs. These programs are installed in the sample subdirectory un...

  • Page 14: Software Overview

    © national instruments corporation 2-1 ni-imaq user manual 2 software overview this chapter describes the classes of ni-imaq functions and briefly describes each function. Introduction ni-imaq functions are grouped according to the following classes: • generic functions • high-level functions – snap...

  • Page 15: Generic Functions

    Chapter 2 software overview ni-imaq user manual 2-2 © national instruments corporation generic functions use generic functions in both high-level and low-level applications. Imginterfaceopen opens by name an interface as specified in the imaq configuration utility. Imgsessionopen opens a session of ...

  • Page 16: Ring and Sequence Functions

    Chapter 2 software overview © national instruments corporation 2-3 ni-imaq user manual imggrabarea performs a transfer from a continuous acquisition. Call this function only after calling imggrabsetup . Ring and sequence functions ring and sequence functions start and stop a continuous acquisition o...

  • Page 17: Miscellaneous Functions

    Chapter 2 software overview ni-imaq user manual 2-4 © national instruments corporation imgsessionwaitsignalasync monitors for a signal to be asserted and invokes a user-defined callback when the signal is asserted. Imgpulsecreate configures the attributes of a pulse. A single pulse consists of a del...

  • Page 18: Low-Level Functions

    Chapter 2 software overview © national instruments corporation 2-5 ni-imaq user manual low-level functions use low-level functions when you require more direct hardware control. Acquisition functions use acquisition functions to configure, start, and abort an image acquisition, or examine a buffer d...

  • Page 19: Attribute Functions

    Chapter 2 software overview ni-imaq user manual 2-6 © national instruments corporation attribute functions use attribute functions to examine and change ni-imaq or camera attributes. Imggetattribute returns an attribute for an interface or session. Imggetcameraattributenumeric gets the value of nume...

  • Page 20: Interface Functions

    Chapter 2 software overview © national instruments corporation 2-7 ni-imaq user manual imggetbufferelement gets an element of a specific type from a buffer list. Imgsessionclearbuffer clears a session’s image data to the specified pixel value. Imgsetarraypointervalue constructs an array of 32-bit po...

  • Page 21: Programming With Ni-Imaq

    © national instruments corporation 3-1 ni-imaq user manual 3 programming with ni-imaq this chapter contains an overview of the ni-imaq library, a description of the programming flow of ni-imaq, and programming examples. Flowcharts are included for the following operations: snap, grab, sequence, ring...

  • Page 22: Low-Level Functions

    Chapter 3 programming with ni-imaq ni-imaq user manual 3-2 © national instruments corporation low-level functions the low-level function set supports all types of acquisition and can be used to: • create a custom acquisition sequence or ring • create and manage your own buffers • set session and int...

  • Page 23: Session Functions

    Chapter 3 programming with ni-imaq © national instruments corporation 3-3 ni-imaq user manual before you can acquire image data successfully, you must open an interface by using the imginterfaceopen function. Imginterfaceopen requires an interface name and returns a handle to this interface. Ni-imaq...

  • Page 24: Managing Buffers

    Chapter 3 programming with ni-imaq ni-imaq user manual 3-4 © national instruments corporation this example opens an interface to img0 and then creates a session to acquire images. When the program is finished with the interface and session, it then closes both handles using the imgclose function. Fo...

  • Page 25: Ni-Imaq Status Signals

    Chapter 3 programming with ni-imaq © national instruments corporation 3-5 ni-imaq user manual attribute value is a numeric value of type integer. Float indicates that the attribute value is a numeric value of type floating point. The valid integer and float values are indicated in possible values. U...

  • Page 26

    Chapter 3 programming with ni-imaq ni-imaq user manual 3-6 © national instruments corporation figure 3-1 illustrates the values of the signals during a three-buffer sequence acquisition. Figure 3-1. Ni-imaq status signals you can use the ni-imaq status signals for many purposes. Pulses can be genera...

  • Page 27: High-Level Snap Functions

    Chapter 3 programming with ni-imaq © national instruments corporation 3-7 ni-imaq user manual high-level snap functions a snap acquires a single image into a memory buffer. Snap functions include imgsnap and imgsnaparea . Use these functions to acquire a single frame or field to a buffer. To use the...

  • Page 28: High-Level Grab Functions

    Chapter 3 programming with ni-imaq ni-imaq user manual 3-8 © national instruments corporation the sample then calls a process function to analyze the image. When the program is finished, it calls imgclose with the interface handle and sets the freeresources flag to true. This instructs ni-imaq to fr...

  • Page 29

    Chapter 3 programming with ni-imaq © national instruments corporation 3-9 ni-imaq user manual figure 3-3. Grab programming flowchart the hlgrab.C example demonstrates how to perform a grab using imggrabarea . The example performs multiple grabs until an appropriate condition is met. The program conf...

  • Page 30

    Chapter 3 programming with ni-imaq ni-imaq user manual 3-10 © national instruments corporation high-level sequence functions sequence functions include imgsequencesetup , imgsessionstartacquisition and imgstopacquisition . A sequence initiates a variable-length and variable-delay transfer to multipl...

  • Page 31: High-Level Ring Functions

    Chapter 3 programming with ni-imaq © national instruments corporation 3-11 ni-imaq user manual the hlseq.C example demonstrates how to perform a sequence acquisition using imgsequencesetup . The example sets up a sequence that uses 10 user-allocated buffers. Unlike the ring example, each buffer in t...

  • Page 32

    Chapter 3 programming with ni-imaq ni-imaq user manual 3-12 © national instruments corporation figure 3-5. Ring programming flowchart the hlring.C example demonstrates how to perform a ring acquisition using imgringsetup . The example sets up a ring containing six buffers and sets the skip count to ...

  • Page 33

    Chapter 3 programming with ni-imaq © national instruments corporation 3-13 ni-imaq user manual the most recent video image. This process will continue until a designated condition is met and then the acquisition stops. High-level signal i/o functions the signal i/o functions fall into two categories...

  • Page 34

    Chapter 3 programming with ni-imaq ni-imaq user manual 3-14 © national instruments corporation figure 3-6. Signal i/o function programming flowchart advanced programming examples you can use low-level functions or combine high-and low-level functions for more advanced programming techniques, includi...

  • Page 35

    Chapter 3 programming with ni-imaq © national instruments corporation 3-15 ni-imaq user manual for you when you acquire an image with it, you must perform the alignment yourself if you use window widths not aligned on a 32-bit boundary. After the program sets the roi, it locks the memory and acquire...

  • Page 36: Stillcolor Snap Programming

    Chapter 3 programming with ni-imaq ni-imaq user manual 3-16 © national instruments corporation the main processing loop of the code shows how to process each buffer acquired in sequential order. Performing a ring acquisition using low-level functions the llring.C example demonstrates how to perform ...

  • Page 37

    Chapter 3 programming with ni-imaq © national instruments corporation 3-17 ni-imaq user manual figure 3-7. Composite stillcolor snap programming flowchart the scsnap.C example demonstrates how to perform a single, composite stillcolor snap. The example first opens an interface and a session. The exa...

  • Page 38: Stillcolor

    © national instruments corporation a-1 ni-imaq user manual a stillcolor this appendix describes the different methods you can use to acquire a color image using the imaq pci/pxi-1408 and national instruments stillcolor technology, explains basic color theories, and describes the different output opt...

  • Page 39: Stillcolor

    Appendix a stillcolor ni-imaq user manual a-2 © national instruments corporation stillcolor stillcolor is a technique you can use to acquire color images from composite color video or rgb cameras using the pci/pxi-1408 monochrome device. Use stillcolor composite mode to acquire color images from a c...

  • Page 40

    Appendix a stillcolor © national instruments corporation a-3 ni-imaq user manual all of the traditional ways to separate the two signals result in visual artifacts on the final picture. Techniques such as frequency-band filtering or comb filtering can minimize some of these artifacts, but most techn...

  • Page 41

    Appendix a stillcolor ni-imaq user manual a-4 © national instruments corporation figure a-1. Classical decoding figure a-2. Stillcolor decoding note you can find color versions of the illustrations in this appendix in the online version of this document included with your ni-imaq software kit. Both ...

  • Page 42: Why Stillcolor?

    Appendix a stillcolor © national instruments corporation a-5 ni-imaq user manual why stillcolor? Stillcolor is optimized for single-frame acquisition. A stillcolor composite acquisition acquires multiple consecutive frames. Assuming that all frames represent the same scene of still objects, the algo...

  • Page 43: Stillcolor Rgb

    Appendix a stillcolor ni-imaq user manual a-6 © national instruments corporation stillcolor rgb rgb cameras output a color image using three lines. Stillcolor rgb will acquire the three signals and construct a color image. The three lines are connected to three channels on the pci/pxi-1408. One fram...

  • Page 44

    Appendix a stillcolor © national instruments corporation a-7 ni-imaq user manual figure a-3. White light and the visible spectrum white light is a combination of all colors at once. The spectrum of white light is continuous and goes from ultraviolet to infrared in a smooth transition. You can repres...

  • Page 45: Image Representations

    Appendix a stillcolor ni-imaq user manual a-8 © national instruments corporation image representations color images can be represented in several different formats. These formats can contain all color information from the image or they can consist of just one aspect of the color information, such as...

  • Page 46: 32-Bit Hsl and Hsi

    Appendix a stillcolor © national instruments corporation a-9 ni-imaq user manual used if you are performing averaging on your image. For example, averaging an image 16 times requires four extra bits (16 = ) to represent the increased dynamic range. In this case, using the 16-bit representation may i...

  • Page 47: Customer Communication

    © national instruments corporation b-1 ni-imaq user manual b customer communication for your convenience, this appendix contains forms to help you gather the information necessary to help us solve your technical problems and a form you can use to comment on the product documentation. When you contac...

  • Page 48: Fax-On-Demand Support

    Ni-imaq user manual b-2 © national instruments corporation fax-on-demand support fax-on-demand is a 24-hour information retrieval system containing a library of documents on a wide range of technical information. You can access fax-on-demand from a touch-tone telephone at 512 418 1111. E-mail suppor...

  • Page 49: Technical Support Form

    Technical support form photocopy this form and update it each time you make changes to your software or hardware, and use the completed copy of this form as a reference for your current configuration. Completing this form accurately before contacting national instruments for technical support helps ...

  • Page 50: Other Products

    Ni-imaq hardware and software configuration form record the settings and revisions of your hardware and software on the line to the right of each item. Complete a new copy of this form each time you revise your software or hardware configuration, and use this form as a reference for your current con...

  • Page 51: Documentation Comment Form

    Documentation comment form national instruments encourages you to comment on the documentation supplied with our products. This information helps us provide quality products to meet your needs. Title: ni-imaq user manual edition date: june 1998 part number: 371443a-01 please comment on the completen...

  • Page 52: Glossary

    © national instruments corporation g-1 ni-imaq user manual glossary prefix meanings value p- pico 10 –12 n- nano- 10 –9 µ- micro- 10 – 6 m- milli- 10 –3 k- kilo- 10 3 m- mega- 10 6 g- giga- 10 9 numbers/symbols +5v 5 v signal – negative of, or minus Ω ohm / per % percent ± plus or minus + positive o...

  • Page 53

    Glossary ni-imaq user manual g-2 © national instruments corporation active line region the region of lines actively being stored; defined by a line start (relative to vsync) and a line count active pixel region the region of pixels actively being stored; defined by a pixel start (relative to hsync) ...

  • Page 54

    Glossary © national instruments corporation g-3 ni-imaq user manual black reference level the level that represents the darkest an image can get. See also white reference level. Buffer temporary storage for acquired data bus the group of conductors that interconnect individual circuitry in a compute...

  • Page 55

    Glossary ni-imaq user manual g-4 © national instruments corporation d d/a digital-to-analog dac digital-to-analog converter; an electronic device, often an integrated circuit, that converts a digital number into a corresponding analog voltage or current daq data acquisition—(1) collecting and measur...

  • Page 56

    Glossary © national instruments corporation g-5 ni-imaq user manual dynamic range the ratio of the largest signal level a circuit can handle to the smallest signal level it can handle (usually taken to be the noise level), normally expressed in decibels e eeprom electrically erasable programmable re...

  • Page 57

    Glossary ni-imaq user manual g-6 © national instruments corporation function a set of software instructions executed by a single line of code that may have input and/or output parameters and returns a value when executed; examples of functions are: y = cos (x) status = ao_config (board, channel, ran...

  • Page 58

    Glossary © national instruments corporation g-7 ni-imaq user manual i ic integrated circuit id identification ieee institute of electrical and electronics engineers in. Inches inl integral nonlinearity—a measure in lsb of the worst-case deviation from the ideal a/d or d/a transfer characteristic of ...

  • Page 59

    Glossary ni-imaq user manual g-8 © national instruments corporation k k kilo—the standard metric prefix for 1,000, or 10 3 , used with units of measure such as volts, hertz, and meters k kilo—the prefix for 1,024, or 2 10 , used with b in quantifying data or computer memory kbytes/s a unit for data ...

  • Page 60

    Glossary © national instruments corporation g-9 ni-imaq user manual memory buffer see buffer. Memory window continuous blocks of memory that can be accessed quickly by changing addresses on the local processor msb most significant bit mtbf mean time between failure mux multiplexer—a switching device...

  • Page 61

    Glossary ni-imaq user manual g-10 © national instruments corporation pclkin pixel clock in signal pfi programmable function input pgia programmable gain instrumentation amplifier picture aspect ratio the ratio of the active pixel region to the active line region; for standard video signals like rs-1...

  • Page 62

    Glossary © national instruments corporation g-11 ni-imaq user manual resolution the smallest signal increment that can be detected by a measurement system; resolution can be expressed in bits, in proportions, or in percent of full scale. For example, a system has 12-bit resolution, one part in 4,096...

  • Page 63

    Glossary ni-imaq user manual g-12 © national instruments corporation syntax the set of rules to which statements must conform in a particular programming language system ram ram installed on a personal computer and used by the operating system, as contrasted with onboard ram t transfer rate the rate...

  • Page 64

    Glossary © national instruments corporation g-13 ni-imaq user manual vsync vertical sync signal—the synchronization pulse generated at the beginning of each video field that tells the video monitor when to start a new field vsyncin vertical sync in signal w white reference level the level that defin...

  • Page 65: Index

    © national instruments corporation i-1 ni-imaq user manual index a acquisition functions, 2-5 application development, 1-2 to 1-4 creating applications, 1-3 ni-imaq libraries, 1-2 attribute functions, 2-6 b buffer management functions list of functions, 2-6 to 2-7 programming considerations, 3-4 bul...

  • Page 66

    Index ni-imaq user manual i-2 © national instruments corporation f fax and telephone support numbers, b-2 fax-on-demand support, b-2 files required for application development, 1-3 ftp support, b-1 functions generic functions, 2-2 high-level functions, 2-2 to 2-4 grab functions, 2-2 to 2-3 miscellan...

  • Page 67

    Index © national instruments corporation i-3 ni-imaq user manual sequence functions, 3-15 to 3-16 snap functions, 3-14 to 3-15 attribute functions, 2-6 buffer management functions, 2-6 to 2-7, 3-4 interface functions, 2-7, 3-2 to 3-3 programming considerations, 3-2 utility functions, 2-7 luminance, ...

  • Page 68

    Index ni-imaq user manual i-4 © national instruments corporation session functions list of functions, 2-4 programming considerations, 3-3 to 3-4 signal i/o functions list of functions, 2-3 to 2-4 programming example, 3-13 to 3-14 snap acquisition, 3-1 snap functions list of functions, 2-2 programmin...