Resumen del contenido incluido en la página 1
UM.book Page 1 Monday, July 13, 1998 9:49 AM
™
IMAQ
™
NI-IMAQ User Manual
Image Acquisition Software
NI-IMAQ User Manual
June 1998 Edition
Part Number 371443A-01
Resumen del contenido incluido en la página 2
UM.book Page 2 Monday, July 13, 1998 9:49 AM 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 Fax: 512 794 5678 International Offices Australia 03 9879 5166, Austria 0662 45 79 90 0, Belgium 02 757 00 20, Brazil 011 288 3336, Canada (Ontario) 905
Resumen del contenido incluido en la página 3
UM.book Page 3 Monday, July 13, 1998 9:49 AM 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. National Instruments will, at its option, repair or replace software media that do not execute programming instructions if National Instruments receive
Resumen del contenido incluido en la página 4
UM.book Page v Monday, July 13, 1998 9:49 AM Contents About This Manual How to Use the NI-IMAQ Manual Set..........................................................................ix Organization of This Manual.........................................................................................ix Conventions Used in This Manual.................................................................................x National Instruments Documentation ...............................................
Resumen del contenido incluido en la página 5
UM.book Page vi Monday, July 13, 1998 9:49 AM Contents Chapter 3 Programming with NI-IMAQ Introduction ................................................................................................................... 3-1 High-Level Functions ..................................................................................... 3-1 Low-Level Functions ...................................................................................... 3-2 Establishing Interface Connections and Sessions.....
Resumen del contenido incluido en la página 6
UM.book Page vii Monday, July 13, 1998 9:49 AM Contents Figures Figure 3-1. NI-IMAQ Status Signals .......................................................................3-6 Figure 3-2. Snap Programming Flowchart...............................................................3-7 Figure 3-3. Grab Programming Flowchart...............................................................3-9 Figure 3-4. Sequence Programming Flowchart .......................................................3-10 Figure 3-5
Resumen del contenido incluido en la página 7
UM.book Page ix Monday, July 13, 1998 9:49 AM 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 software. How to Use the NI-IMAQ Manual Set To install your software and documentation set, you should begin by reading the setup and test document included with your hardware and the NI-IMAQ release notes.
Resumen del contenido incluido en la página 8
UM.book Page x Monday, July 13, 1998 9:49 AM About This Manual • 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 in this manual, including abbreviations, acronyms, metric prefixes, mnemonics, and symbols. • The Index contains an alphabetical list of key terms and topics in this manual, including the page where you c
Resumen del contenido incluido en la página 9
UM.book Page xi Monday, July 13, 1998 9:49 AM About This 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 the documents you have as follows: • Your IMAQ hardware documentation—These documents have detailed information about the IMAQ hardware that plugs into or is connected to your computer. Use these manuals f
Resumen del contenido incluido en la página 10
UM.book Page 1 Monday, July 13, 1998 9:49 AM 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, describes the files used to build these applications, and tells you where to find sample programs. About the NI-IMAQ Software Thank you for buying a National Instruments image acquisition (IMAQ) device, which i
Resumen del contenido incluido en la página 11
UM.book Page 2 Monday, July 13, 1998 9:49 AM Chapter 1 Introduction to NI-IMAQ 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/CVI version 4.x and higher • BridgeVIEW version 1.x and higher • Borland C/C++ version 4.0 and higher • Microsoft Visual C/C++ version 2.0 and higher • Microsoft Visual Basic version 4.0 and higher Note Although
Resumen del contenido incluido en la página 12
UM.book Page 3 Monday, July 13, 1998 9:49 AM Chapter 1 Introduction to NI-IMAQ 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 included. For information on creating and managing project files, consult the documentation included with your particular development environment. When programming, use the following guidelines: • You must define
Resumen del contenido incluido en la página 13
UM.book Page 4 Monday, July 13, 1998 9:49 AM Chapter 1 Introduction to NI-IMAQ 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 under the target installation folder if you elected to install the sample files. NI-IMAQ User Manual 1-4 © National Instruments Corporation
Resumen del contenido incluido en la página 14
UM.book Page 1 Monday, July 13, 1998 9:49 AM 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 functions – Grab functions – Ring and sequence functions – Signal I/O functions – Miscellaneous functions • Low-level functions – Acquisition functions – Attribute functions – Buffer management functions – Int
Resumen del contenido incluido en la página 15
UM.book Page 2 Monday, July 13, 1998 9:49 AM Chapter 2 Software Overview 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 an unknown type and returns a session ID. imgClose Closes a session or interface and unlocks and releases all buffers associated with the data type. High-Level Functions Use high-level functions to quickly a
Resumen del contenido incluido en la página 16
UM.book Page 3 Monday, July 13, 1998 9:49 AM Chapter 2 Software Overview 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
Resumen del contenido incluido en la página 17
UM.book Page 4 Monday, July 13, 1998 9:49 AM Chapter 2 Software Overview 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 delay phase (phase 1), followed by a pulse phase (phase 2), and then a return to the phase 1 level. imgPulseDispose Disposes of a pulse ID. imgPulseRate Converts delay and width into delay, width, and timeba
Resumen del contenido incluido en la página 18
UM.book Page 5 Monday, July 13, 1998 9:49 AM Chapter 2 Software Overview 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 during an acquisition. imgMemLock Locks all session-associated image buffers in memory in preparation for an acquisition. imgMemUnlock Unlocks all session-associated buffers. imgSessionAbort Stops an asynchron
Resumen del contenido incluido en la página 19
UM.book Page 6 Monday, July 13, 1998 9:49 AM Chapter 2 Software Overview 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 numeric camera attributes. imgGetCameraAttributeString Gets the value of camera attributes. imgSessionGetLostFramesList Gets information about frames that were overwritten during a continuous acquisition. imgSe
Resumen del contenido incluido en la página 20
UM.book Page 7 Monday, July 13, 1998 9:49 AM Chapter 2 Software Overview 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 pointers (a Visual Basic helper function). imgSetBufferElement Sets a buffer list element of a given type to a specific value. Interface Functions Interface functions load and control the selected IMAQ device