Manuel d'utilisation / d'entretien du produit NI-IMAQdx du fabricant National Instruments
Aller à la page of 65
NI-IMAQdx TM NI-IMAQdx User Manual Image Acquisition Software NI-IMAQdx User Manual February 2007 371970B-01.
Support Worldwide Technical Support and Product Info rmation ni.com National Instruments Corporate Headquarters 11500 North Mopac Expressway Aust in, Texas 78759-3504 USA Tel: 512 683 0100 Worldwide O.
Important Information Warranty The media on which you receive Natio nal In struments software are warranted not to fail to execute programming instructi ons, due to defects in materials and workmanship, for a period of 90 days from date of shipment, as eviden ced by receipts or other documentat ion.
Conventions The follo wing con ve ntions 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 yo u to pull down the File menu, select the Page Setup item, and select Options from the last dialog box.
© National Instruments Corpor ation v NI-IMAQdx User Manual Contents Chapter 1 Introduction to NI-IMAQdx About the NI-IMAQdx Software .............. .............. .............. ................. .............. .......... 1-1 Application Development Environments .
Contents NI-IMAQdx User Manual vi ni.com Chapter 3 Advanced Programming with NI-IMAQdx Camera Attributes ............... .............. ............... .............. ................. .............. .............. ... 3-1 Attribute Name .............
Contents © National Instruments Corpor ation vii NI-IMAQdx User Manual Chapter 5 Using NI-IMAQdx in C and .NET Using NI-IMAQdx for C ....................... .............. .............. .............. .............. .............. .. 5-1 Using NI-IMAQdx for Microsoft Visual Studio .
© National Instruments Corpor ation 1-1 NI-IMAQdx User Manual 1 Introduction to NI-IMAQdx This chapter describes the NI-IMAQdx driver software, li sts the supported application development enviro nme.
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 v ersion 7.
Chapter 1 Introduction to NI-IMAQdx © National Instruments Corpor ation 1-3 NI-IMAQdx User Manual Fundamentals of Building Applications with NI-IMAQdx Architecture Figure 1-1 illustrates the NI -IMAQdx dri ver architecture.
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 routi nes are not linked into the executable files of applications.
© National Instruments Corpor ation 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 programmin g examples. The chapter also contains flowcharts of high-level and low-l evel snap , grab , and sequence operati ons.
Chapter 2 Basic Acquisition with NI-IMAQdx NI-IMAQdx User Manual 2-2 ni.com Both high-level and low-l evel functions supp ort snap, grab, seq uence, and triggered acquisitions. Using high -lev el functions, you can write programs quickly without havin g to learn the details of the low-lev el API and driver.
Chapter 2 Basic Acquisition w ith NI-IMAQdx © National Instruments Corpor ation 2-3 NI-IMAQdx User Manual Camera Name NI-IMAQdx references all camera sessi ons by a name. The driver creates default names for each camera in your sy stem in the order that the cameras are connected.
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.
Chapter 2 Basic Acquisition w ith NI-IMAQdx © National Instruments Corpor ation 2-5 NI-IMAQdx User Manual acquisition. Nationa l Instruments recommends one-shot acqu isition for applications that do not require real-time acquisition or processing.
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 mo des, the ROI specifies the amount of data decoded by the driver while acquiring into a user buffer. By default, the dri ver transfers the en tire image.
Chapter 2 Basic Acquisition w ith NI-IMAQdx © National Instruments Corpor ation 2-7 NI-IMAQdx User Manual Buffer Number Mo de Specify one of the following opt ions for the buffer number mode. • Buffer Number—Gets the e xact buff er number specified in the Buf fer Number parameter .
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 b uffer . This option, which National Instruments recommends for most applications, enables you to process th e most recent image.
Chapter 2 Basic Acquisition w ith NI-IMAQdx © National Instruments Corpor ation 2-9 NI-IMAQdx User Manual Decoding images requires CPU resources . Howe ver , many of the decoding algorithms have been optimized in the driver . If you do not want decoded image data, you can use NI-IMA Qdx to get a copy of the raw camera output.
Chapter 2 Basic Acquisition with NI-IMAQdx NI-IMAQdx User Manual 2-10 ni.com Note If you do not hav e a va lid session, a temporary session is created using cam0 . Then, the snap acquires the ne xt incomi ng image into a user b uffer . After the image is acquired, the program ca lls image processing and analysis functions.
Chapter 2 Basic Acquisition w ith NI-IMAQdx © National Instruments Corporat ion 2-11 NI-IMAQdx User Manual Calling the Configure Grab function opens a session for a grab acquisition. During acquisition, each successi ve grab copies the last acquired internal buf fer into a user buf fer wh ere you can process the image.
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 acquisitio n and start the acquisition. The program acquires an image and processes it. Finally, the program stops the acquisi tion, unconfigures the acquisitio n, and closes the session.
Chapter 2 Basic Acquisition w ith NI-IMAQdx © National Instruments Corporat ion 2-13 NI-IMAQdx User Manual Grab The low-level grab examples dem onstrate how to perform a g rab acquisition using low-level functi on calls. The program sets up a continuous acquisition into three in tern al buffers and star ts the acquisition.
Chapter 2 Basic Acquisition with NI-IMAQdx NI-IMAQdx User Manual 2-14 ni.com Sequence The low-level sequence examples dem onstrate how to perform a sequence acquisition using low-level calls. The prog ram sets up a one-shot, multi-image acquisitio n and starts the acquisition.
© National Instruments Corpor ation 3-1 NI-IMAQdx User Manual 3 Advanced Programming with NI-IMAQdx This chapter contains informatio n about setting camera attributes, broadcasting acquired images to multiple mach ines, using scale to define the size of transferred images, and triggering.
Chapter 3 Advanced Pr ogra mming w ith NI-IMAQdx NI-IMAQdx User Manual 3-2 ni.com Attribute T ype The attribute type determines how a came ra attribute is stor ed in the driver and the camera. Use the Get Attribut e Type function to query the type of a given attribute.
Chapter 3 Advanced Progra mming with NI-IMAQdx © National Instruments Corpor ation 3-3 NI-IMAQdx User Manual The following v alu e type s are compatible for any gi ven attrib ute type. The bolded compatible value type indicates the native v alue type.
Chapter 3 Advanced Pr ogra mming w ith NI-IMAQdx NI-IMAQdx User Manual 3-4 ni.com The follo wing range is appli cable for any gi ven attrib ute. Broadcasting Many machine vision applications involv e a single host computer acquiring data from a single industrial cam era.
Chapter 3 Advanced Progra mming with NI-IMAQdx © National Instruments Corpor ation 3-5 NI-IMAQdx User Manual Figure 3-1. One Came ra Broadcasting to Multiple Host Computer s The camera broadcasts video data on the camera bus and all the connected host computers recei ve the same image data.
Chapter 3 Advanced Pr ogra mming w ith NI-IMAQdx NI-IMAQdx User Manual 3-6 ni.com For GigE V ision cameras, you can conf igure the camera to broadcast or multicast image data to all nodes on the network. Broadcast is not routable, and ev eryo ne on the same network sees the data, ev en if they are not listening.
Chapter 3 Advanced Progra mming with NI-IMAQdx © National Instruments Corpor ation 3-7 NI-IMAQdx User Manual The Increment values are camera-specif ic. Refer to the camera documentation or query th e Increment attrib utes for width and height to obtain the act ual values.
Chapter 3 Advanced Pr ogra mming w ith NI-IMAQdx NI-IMAQdx User Manual 3-8 ni.com • TriggerParameter —Certain trigger mod es require an additional parameter .
Chapter 3 Advanced Progra mming with NI-IMAQdx © National Instruments Corpor ation 3-9 NI-IMAQdx User Manual T rigger Mode 2 With trigger mode 2, the camera starts frame integration when the external trigger input changes to an active va lue. The same frame is exposed for multiple triggers.
Chapter 3 Advanced Pr ogra mming w ith NI-IMAQdx NI-IMAQdx User Manual 3-10 ni.com T rigger Mode 4 With trigger mode 4, the camera starts frame integration when the external trigger input changes to an active va lue. Multiple frames are exposed before the camera transfers the image to the host computer.
Chapter 3 Advanced Progra mming with NI-IMAQdx © National Instruments Corporat ion 3-11 NI-IMAQdx User Manual T rigger Modes for Gi gE Vision Cameras Note All triggering mo des and parameters for Gi gE V ision cameras are subject to camera vendor implementation.
© National Instruments Corpor ation 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) th at enable you to use LabVIEW with your camera.
Chapter 4 Using NI-IMAQd x in LabVIEW © National Instruments Corpor ation 4-2 NI-IMAQdx User Manual The Vision and Motion»NI-IMAQ dx»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.
Chapter 4 U sing NI-I MAQdx in LabVIEW NI-IMAQdx User Manual 4-3 ni.com Acquisition VIs Two types of acquisition VIs are ava ilable in LabVIEW: high-l evel and low-level. High-Level Use the high-level acquisition VIs for ba sic image acquisiti on appli cations.
Chapter 4 Using NI-IMAQd x in LabVIEW © National Instruments Corpor ation 4-4 NI-IMAQdx User Manual Buffer Management The IMAQ Create VI and IMAQ Dispose VI manage image buffers in LabVIEW. IMA Q Create, shown in Figure 4-1, allocates an image buf fer .
Chapter 4 U sing NI-I MAQdx in LabVIEW NI-IMAQdx User Manual 4-5 ni.com Acquisition T ypes The following sections describe snap , grab, and sequen ce acquisitions in LabVIEW and give examples. Snap Use the IMAQdx Snap VI for snap applications. Figure 4-3 shows a simplified block diagram for using IMAQdx Snap.
Chapter 4 Using NI-IMAQd x in LabVIEW © National Instruments Corpor ation 4-6 NI-IMAQdx User Manual Figure 4-4 shows a simplif ied block diagram for using IMA Qdx Configure Grab and IMA Qdx Grab. Figure 4-4. Acquiring Images Using Gr ab Sequence Use the IMAQdx Sequence VI for sequence applications.
Chapter 4 U sing NI-I MAQdx in LabVIEW NI-IMAQdx User Manual 4-7 ni.com Image Display Many image acquisition applicatio ns require that one or more images be displayed.
Chapter 4 Using NI-IMAQd x in LabVIEW © National Instruments Corpor ation 4-8 NI-IMAQdx User Manual If you hav e LabVIEW R T , you can use IMA Q R T V ideo Out, located at Vision and Motion»Vision Utiliti es»IMAQ RT , to display an image on the monitor connected to your R T device.
Chapter 4 U sing NI-I MAQdx in LabVIEW NI-IMAQdx User Manual 4-9 ni.com Figure 4-9 sho ws ho w to set camera attr ib u tes with the p roperty nodes in NI-IMA Qdx. 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 output cluster.
Chapter 4 Using NI-IMAQd x in LabVIEW © National Instruments Corporat ion 4-10 NI-IMAQdx User Manual Y ou can use the Simple Error Handler VI, located on the Functions» Dialog & User Interface palette, to check for errors that occur while ex ecuting a VI.
© National Instruments Corpor ation 5-1 NI-IMAQdx User Manual 5 Using NI-IMAQdx in C and .NET This chapter briefly describes how to use NI-IMAQdx fu nctions in Microsoft Visual C and Microsoft Visual Studio .NET. Using NI-IMAQdx for C This section outlines the process for developing NI-IMAQdx appl ications using C.
Chapter 5 Using NI-IMAQdx in C and .NET © National Instruments Corpor ation 5-2 NI-IMAQdx User Manual Y ou can use the additional Image functions installed with NI-IMA Qdx. These functions use the NI V ision memory manageme nt feature, which automatically allocates the memory for your image.
Chapter 5 U sing 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 CWIMA QV iewer control. When the V iewer control is in the toolbox, you can add it to your form s by clicking on the tool and drawing an area on the form.
© National Instruments Corpor ation A-1 NI-IMAQdx User Manual A Register -Level Programming This appendix explains ho w to access an d program register locations using the NI-IMA Qdx software, and disc usses the ca veats in volv ed in programming registers.
Appendix A Register- Level Programming NI-IMAQdx User Manual A- 2 ni.com Figure A-1. Explanation of Split T ransactions NI-IMA Qdx supports the 1394 T rade Association IIDC 1.31 register specification and the GigE V ision 1.0 specification for industrial cameras.
Appendix A Regist er -Level Progr amming © National Instruments Corpor ation A-3 NI-IMAQdx User Manual The NI-IMA Q dx software provides the following register-le vel primitives: • Read Register—.
Appendix A Register- Level Programming NI-IMAQdx User Manual A- 4 ni.com Advanced Example The adv anced feature described in th is e xample is specif i c to Basler IEEE 1394 cameras. The advanced feature replaces the li ve video feed with a static test pattern.
Appendix A Regist er -Level Progr amming © National Instruments Corpor ation A-5 NI-IMAQdx User Manual endian data. T o correct for this discrepancy , NI-IMA Qdx byte-swaps e very quadlet that is read or writt en with low-le vel register primitiv es.
© National Instruments Corpor ation B-1 NI-IMAQdx User Manual B T echnical Support and Professional Ser vices Visit the following sections of the National Instruments Web site at ni.com for technical support an d professional services: • Support —Online technical support resources at ni.
© National Instruments Corpor ation G-1 NI-IMAQdx User Manual Glossar y A acquisition windo w The image size specific to a video standard or camera resolution. address V alue that identif ies a specific lo cation (or series of locations) in memory . API Application programming interface.
Glossary NI-IMAQdx User Manual G-2 ni.com D default setting A default parameter value record ed in the driv er . In many cases, the default input of a control is a certain v alue (often 0).
Glossary © National Instruments Corpor ation G-3 NI-IMAQdx User Manual GigE V ision A camera interface standard dev eloped using the Gigabit Ethernet communication protocol.
Glossary NI-IMAQdx User Manual G-4 ni.com M MAX Measurement & Auto mation Explor er—A controlled, centralized configuration en vironm ent that allows you to conf ig ure all of your NI de vices. N NI-IMA Q Dri ver software for National Instruments image acquisition hardware.
Glossary © National Instruments Corpor ation G-5 NI-IMAQdx User Manual R real time A property of an ev en t or system in which data is processed as it is acqu ired instead of being accumulated and processed at a later time. resolution (1) The number of ro ws and co lumns of pixels.
Glossary NI-IMAQdx User Manual G-6 ni.com U user buf fer A memory buf fer created by th e user as a destination for the image. In LabVIEW , this is created with the IMA Q Create VI.
© National Instruments Corpor ation I-1 NI-IMAQdx User Manual Index A adv anced programming examples grab using low-le vel functions, 2-13 sequence using low-le vel functions, 2-14 snap using low-le vel functions, 2-12 application development, 1-3 C, 5-1 en vironments, 1-2 LabVIEW, 4-1 LabVIEW Real-T ime Module, 4-1 .
Index NI-IMAQdx User Manual I-2 ni.com F features and ov ervie w, 1-1 Format 7 video mode, 3-1, 3-6 front panel, LabVIEW, 4 -1, 4-7 G grab high-lev el, 2-1, 2-7, 2-10, 4-5 flo wchart, 2-10 in LabVIEW (figure), 4-6 low-le vel, 2-13 flo wchart, 2-13 H help, technical support, B-1 high-lev el functions, when to use, 2-1 I image buf fer .
Index © National Instruments Corpor ation I-3 NI-IMAQdx User Manual architecture, 1-3 libraries, 1-4 O ov erwrite mode, 2-7 P programming guidelines for C, 5-1 high-lev el functions, 2-1 introduction.
Index NI-IMAQdx User Manual I-4 ni.com V VI parameters, 4-2 video mode decoding, 2-8 table, 2-8 R O I considerations, 2-6 V isual Basic programming language, 1-2 V isual Studi o .
Un point important après l'achat de l'appareil (ou même avant l'achat) est de lire le manuel d'utilisation. Nous devons le faire pour quelques raisons simples:
Si vous n'avez pas encore acheté National Instruments NI-IMAQdx c'est un bon moment pour vous familiariser avec les données de base sur le produit. Consulter d'abord les pages initiales du manuel d'utilisation, que vous trouverez ci-dessus. Vous devriez y trouver les données techniques les plus importants du National Instruments NI-IMAQdx - de cette manière, vous pouvez vérifier si l'équipement répond à vos besoins. Explorant les pages suivantes du manuel d'utilisation National Instruments NI-IMAQdx, vous apprendrez toutes les caractéristiques du produit et des informations sur son fonctionnement. Les informations sur le National Instruments NI-IMAQdx va certainement vous aider à prendre une décision concernant l'achat.
Dans une situation où vous avez déjà le National Instruments NI-IMAQdx, mais vous avez pas encore lu le manuel d'utilisation, vous devez le faire pour les raisons décrites ci-dessus,. Vous saurez alors si vous avez correctement utilisé les fonctions disponibles, et si vous avez commis des erreurs qui peuvent réduire la durée de vie du National Instruments NI-IMAQdx.
Cependant, l'un des rôles les plus importants pour l'utilisateur joués par les manuels d'utilisateur est d'aider à résoudre les problèmes concernant le National Instruments NI-IMAQdx. Presque toujours, vous y trouverez Troubleshooting, soit les pannes et les défaillances les plus fréquentes de l'apparei National Instruments NI-IMAQdx ainsi que les instructions sur la façon de les résoudre. Même si vous ne parvenez pas à résoudre le problème, le manuel d‘utilisation va vous montrer le chemin d'une nouvelle procédure – le contact avec le centre de service à la clientèle ou le service le plus proche.