background image

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 of 
multiple fields or frames.

imgRingSetup

Prepares a session for acquiring 
continuously and looping into a buffer 
list.

imgSequenceSetup

Prepares a session for acquiring a full 
sequence into the buffer list.

imgSessionStartAcquisition

Starts a session acquisition identified by 
the session ID.

imgSessionStopAcquisition

Stops a session acquisition identified by 
the session ID.

Signal I/O Functions

Signal I/O functions control the trigger lines on IMAQ devices.

imgSessionTriggerConfigure

Configures an acquisition to start based 
on an external trigger.

imgSessionLineTrigSource

Configures triggering per line for 
acquisition from a line scan camera.

imgSessionTriggerClear

Disables all triggers on the session.

imgSessionTriggerDrive

Configures the specified trigger line to 
drive a signal out.

imgSessionTriggerRead

Reads the current value of the specified 
trigger line.

imgSessionWaitSignal

Waits for a signal to be asserted. This 
function will return when the specified 
signal is asserted.

UM.book  Page 3  Monday, July 13, 1998  9:49 AM

Содержание Image Acquisition Software

Страница 1: ...IMAQ NI IMAQ User Manual Image Acquisition Software NI IMAQ User Manual June 1998 Edition Part Number 371443A 01 UM book Page 1 Monday July 13 1998 9 49 AM...

Страница 2: ...785 0085 Canada Qu bec 514 694 8521 Denmark 45 76 26 00 Finland 09 725 725 11 France 01 48 14 24 24 Germany 089 741 31 30 Hong Kong 2645 3186 Israel 03 6120092 Italy 02 413091 Japan 03 5472 2970 Korea...

Страница 3: ...act or tort including negligence Any action against National Instruments must be brought within one year after the cause of action accrues National Instruments shall not be liable for any delay in per...

Страница 4: ...ent Environments 1 2 Fundamentals of Building Applications with NI IMAQ 1 2 The NI IMAQ Libraries 1 2 Creating an Application 1 3 Sample Programs 1 4 Chapter 2 Software Overview Introduction 2 1 Gener...

Страница 5: ...High Level Snap Functions 3 7 High Level Grab Functions 3 8 High Level Sequence Functions 3 10 High Level Ring Functions 3 11 High Level Signal I O Functions 3 13 Advanced Programming Examples 3 14 P...

Страница 6: ...Flowchart 3 10 Figure 3 5 Ring Programming Flowchart 3 12 Figure 3 6 Signal I O Function Programming Flowchart 3 14 Figure 3 7 Composite StillColor Snap Programming Flowchart 3 17 Figure A 1 Classica...

Страница 7: ...ction Reference Manual which contains detailed descriptions of the NI IMAQ functions Organization of This Manual The NI IMAQ User Manual is organized as follows Chapter 1 Introduction to NI IMAQ descr...

Страница 8: ...ote which alerts you to important information bold Bold text denotes menus menu items or dialog box buttons or options bold italic Bold italic text denotes a note caution or warning italic Italic text...

Страница 9: ...tion software LabVIEW or LabWindows CVI or the NI IMAQ documentation to help you write your application If you have a large and complicated system it is worthwhile to look through the software documen...

Страница 10: ...O functions for maximum flexibility and performance Examples of high level functions are snap and grab image acquisition Examples of low level functions are buffer setup and video configuration NI IMA...

Страница 11: ...a may be compressed Always run the NI IMAQ installation utility to extract the files you want For a brief description of the directories produced by the install programs and the names and purposes of...

Страница 12: ...must include the NIIMAQ H header file Add this file to the top of your source files You must add the IMAQ LIB import library to your project Some environments allow you to add import libraries simply...

Страница 13: ...ease 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 under the targ...

Страница 14: ...ctions Snap functions Grab functions Ring and sequence functions Signal I O functions Miscellaneous functions Low level functions Acquisition functions Attribute functions Buffer management functions...

Страница 15: ...you need more advanced functionality you can mix high level functions with low level functions Snap Functions Snap functions program the session to capture all or a portion of a single frame or field...

Страница 16: ...tified by the session ID imgSessionStopAcquisition Stops a session acquisition identified by the session ID Signal I O Functions Signal I O functions control the trigger lines on IMAQ devices imgSessi...

Страница 17: ...o delay width and timebase values needed by imgPulseCreate imgPulseStart Starts the generation of a pulse You must call imgPulseCreate first to configure the pulse imgPulseStop Stops the generation of...

Страница 18: ...ous continuous acquisition immediately imgSessionAcquire Starts acquisition synchronously or asynchronously to the frame buffers in the associated session buffer list imgSessionConfigure Specifies the...

Страница 19: ...uous acquisition imgSetAttribute Sets an attribute for an interface or session imgSetCameraAttributeNumeric Sets the value of numeric camera attributes imgSetCameraAttributeString Sets the value of ca...

Страница 20: ...k Locks a logical interface so that another process cannot use it imgInterfaceQueryNames Returns the interface name identified by the index parameter imgInterfaceReset Performs a hardware reset on the...

Страница 21: ...s call low level functions and use certain attributes that are listed in the high level function description in the NI IMAQ Function Reference Manual Changing the value of these attributes while using...

Страница 22: ...ion Functions sections in this chapter for information on how to manage interfaces and sessions then refer to the high level or low level samples for information on acquiring images Interface Function...

Страница 23: ...nction For a complete list of the available interface functions refer to the NI IMAQ Function Reference Manual Session Functions Use session functions to configure the type of acquisition you want to...

Страница 24: ...ffers using either approach dispose of the buffers using free or imgDisposeBuffer when applicable to free PC memory for maximum performance Camera Attributes The camera attributes allow you to control...

Страница 25: ...data is transferred to memory this signal goes FALSE If the acquisition is a sequence acquisition in progress will stay TRUE throughout the acquisition until the entire sequence is completed Acquisiti...

Страница 26: ...ing routine as soon as an image is in memory You can configure a callback containing image processing code to be invoked when Buffer Complete is asserted Introductory Programming Examples This section...

Страница 27: ...mgSnap to automatically allocate a buffer for the image The size of the buffer is calculated based on the region of interest ROI and the rowPixel attributes ROI height multiplied by rowPixel multiplie...

Страница 28: ...host memory Grab functions include imgGrabSetup imgGrab and imgGrabArea You can use these functions to perform an acquisition that loops continually on one buffer A copy of the acquisition buffer is...

Страница 29: ...interface by calling imgClose imgInterfaceOpen imgInterfaceOpen opens and configures the interface according to the file setup by the IMAQ Configuration Utility imgGrab copies the contents of the driv...

Страница 30: ...between each image Figure 3 4 illustrates a typical sequence programming order Figure 3 4 Sequence Programming Flowchart imgInterfaceOpen imgInterfaceOpen opens and configures the interface according...

Страница 31: ...continuous high speed acquisition to multiple buffers Calling imgRingSetup initiates a ring imgRingSetup specifies both the buffer list that will be used for transfers and the number of buffers After...

Страница 32: ...eOpen imgInterfaceOpen opens and configures the interface according to the file setup by the IMAQ Configuration Utility imgSessionStatus gives the current status of the ring including the buffer numbe...

Страница 33: ...h buffer in the list can be triggered After using this function to set up the trigger any acquisition performed on the session will wait for a trigger Use imgSessionTriggerClear to remove the trigger...

Страница 34: ...t your image is acquired properly The software does not perform this alignment for you unless you select a scaling option Although the IMAQ Configuration Utility performs this alignment imgSessionTrig...

Страница 35: ...nously The main processing loop of the code shows how to wait for vertical blank and copy the buffer to an analysis buffer Keep your analysis code fast to minimize the number of missed frames during a...

Страница 36: ...or each buffer element in the ring The memory is locked and the image acquisition is started asynchronously The main processing loop of the code shows how to wait for the first buffer to be filled and...

Страница 37: ...gInterfaceOpen opens and configures the interface according to the file setup by the IMAQ Configuration Utility imgSessionOpen opens a session that will be used for all acquisition and configuration U...

Страница 38: ...on A composite color camera transmits the video signal on a single wire The signal is composed of two components that are added together These components are A monochrome video signal that contains th...

Страница 39: ...till or very slowly moving objects StillColor supports many different image representations used in scientific or industrial applications such as RGB bitmap and single plane hue saturation luminance a...

Страница 40: ...vantage of the slow response time of the human eye to obscure most of these problems The situation is different in a single frame acquisition where a single image is needed A single image usually clea...

Страница 41: ...endix in the online version of this document included with your NI IMAQ software kit Both pictures are approximately 80 by 80 pixels in size and are acquired using an NTSC composite video signal Figur...

Страница 42: ...uire three consecutive frames but the same perfect separation of the color and luminance information can be achieved after manipulation of these images After separating the color and luminance signals...

Страница 43: ...green and blue to Video 1 Video 2 and Video 3 respectively on the PCI PXI 1408 device Specify a channel for the video synchronization signal by selecting that channel as the sync source using the Oper...

Страница 44: ...RGB camera uses red green and blue sensors The perception of a color depends on many factors such as Hue which is the perceived dominant color Hue depends directly on the wavelength of a color Satura...

Страница 45: ...t representation the image is packed into an array of 16 bit integers where each 16 bit pixel contains red green and blue encoded with only five bits each The most significant bit of the integer is al...

Страница 46: ...Saturation are defined using the Red Green and Blue values in the following formulas Luminance 0 299 Red 0 587 Green 0 114 Blue Intensity Red Green Blue 3 Hue ATN2 Y X where Y Green Blue and X 2 Red G...

Страница 47: ...stions we offer fax and telephone support through our technical support centers which are staffed by applications engineers Electronic Services Bulletin Board Support National Instruments has BBS and...

Страница 48: ...contact the source from which you purchased your software to obtain support Country Telephone Fax Australia 03 9879 5166 03 9879 6277 Austria 0662 45 79 90 0 0662 45 79 90 19 Belgium 02 757 00 20 02...

Страница 49: ...________________________________________________________________ _______________________________________________________________________________ National Instruments hardware product model ___________...

Страница 50: ...other boards _____________________________________________________ Interrupt level of other boards ______________________________________________________ Other Products Computer make and model ______...

Страница 51: ...________________________________________________________________ _______________________________________________________________________________ _______________________________________________________...

Страница 52: ...ro 10 6 m milli 10 3 k kilo 103 M mega 106 G giga 109 Numbers Symbols 5V 5 V signal negative of or minus ohm per percent plus or minus positive of or plus A A amperes AC alternating current acquisitio...

Страница 53: ...interface AQ_DONE signals that the acquisition of a frame or field is completed AQ_IN_PROGRESS signals that the acquisition of video data is in progress area a rectangular portion of an acquisition w...

Страница 54: ...dards for color video signals chrominance the color information in a video signal CMOS complementary metal oxide semiconductor compiler a software utility that converts a source program in a high leve...

Страница 55: ...ignals in volts DC direct current default setting a default parameter value recorded in the driver in many cases the default input of a control is a certain value often 0 that means use the current de...

Страница 56: ...red lines FIFO first in first out memory buffer the first data stored is the first data sent to the acceptor FIFOs are used on IMAQ devices to temporarily store incoming data until that data can be re...

Страница 57: ...er interface an intuitive easy to use means of communicating information to and from a computer program by means of graphical screen displays GUIs can resemble the front panels of instruments or other...

Страница 58: ...frame interpreter a software utility that executes source code from a high level language such as Basic C or Pascal by reading one line at a time and executing the specified operation See also compil...

Страница 59: ...gnificant bit luminance the brightness information in the video picture The luminance signal amplitude varies in proportion to the brightness of the video signal and corresponds exactly to the monochr...

Страница 60: ...ed the color video standard used primarily in North America which uses 525 lines per frame See also PAL NVRAM nonvolatile RAM RAM that is not erased when a device loses power or is turned off O operat...

Страница 61: ...pically it falls between 0 95 and 1 05 depending on camera quality pixel clock divides the incoming horizontal video line into pixels pixel count the total number of pixels between two HYSNCs the pixe...

Страница 62: ...Time System Integration Bus the National Instruments timing bus that connects IMAQ and DAQ boards directly by means of connectors on top of the boards for precise synchronization of functions S s sec...

Страница 63: ...y circuitry that routes monitors and drives the external and RTSI bus trigger lines you can configure each of these lines to start or stop acquisition on a rising or falling edge TTL transistor transi...

Страница 64: ...ical sync in signal W white reference level the level that defines what is white for a particular video system See also black reference level Y YUV a representation of a color image used for the codin...

Страница 65: ...ras A 1 customer communication xi B 1 to B 2 D documentation conventions used in manual x how to use NI IMAQ manual set ix National Instruments documentation xi organization of manual ix x related doc...

Страница 66: ...list of functions 2 2 to 2 3 programming examples high level functions 3 8 to 3 9 low level functions 3 15 H header files 1 3 high level functions 2 2 to 2 4 grab functions 2 2 to 2 3 introductory pr...

Страница 67: ...lor snap programming 3 16 to 3 17 buffer management 3 4 camera attributes 3 4 to 3 5 high level functions 3 1 interface functions 3 2 to 3 3 introductory examples 3 6 to 3 14 high level grab functions...

Страница 68: ...8 low level functions 3 14 to 3 15 status signals 3 5 to 3 6 StillColor A 1 to A 6 advantages A 5 composite color acquisition A 5 composite color video signals A 2 to A 4 overview A 1 purpose and use...

Отзывы: