Ingeniero

Páginas: 15 (3572 palabras) Publicado: 21 de octubre de 2012
Document Type: Tutorial NI Supported: Yes Publish Date: Apr 24, 2012

USB Instrument Control Tutorial
Overview This tutorial is meant as a starting point for using NI-VISA to communicate with a USB device. It is not intended as a starting point for learning about USB architecture or the various protocols used in USB communication. After reading this tutorial, you should be able to install aUSB device and use NI-VISA to communicate with that device, as long as you understand the device communication protocol.

Table of Contents 1. 2. 3. 4. 1. USB and VISA Background 2. Configuring NI-VISA to Control Your USB Device 3. Using NI-VISA to Communicate with Your USB Device 4. USB on Linux® and Mac

1. USB and VISA Background VISA is a high-level API used to communicate withinstrumentation buses. It is platform independent, bus independent, and environment independent. In other words, the same API is used regardless of whether a program is created to communicate with a USB device with LabVIEW on a machine running Windows 7 or with a GPIB device with C on a machine running Mac OS X. USB is a message-based communication bus. This means a PC and a USB device communicate by sendingcommands and data over the bus as text or binary data. Each USB device has its own command set. You can use NI-VISA Read and Write functions to send these commands to an instrument and read the response from an instrument. Check with your instrument manufacturer for a list of valid commands for your instrument. Starting with version 3.0, NI-VISA supports USB communication. Two classes of VISAresources are supported: USB INSTR and USB RAW. USB devices that conform to the USB Test and Measurement Class (USBTMC) protocol use the USB INSTR resource class. USBTMC devices conform to a protocol that the VISA USB INSTR instrument control resource class can understand. No configuration is necessary to communicate with a USBTMC device. To communicate with a USBTMC instrument, refer to section 3. Formore information about the USBTMC specification, refer to the USB Implementers Forum Web page linked below. USB RAW instruments are any USB instrument other than those instruments that specifically conform to the USBTMC specification. If you are using a USB RAW device, follow the instructions in section 2 to configure NI-VISA to control your device. Contact your instrument manufacturer fordetails about the communication protocol and the command set your instrument uses. For specific information about the NI-VISA API, refer to the NI-VISA Help. This document is included with NI-VISA and is available through the link at the end of this tutorial. 2. Configuring NI-VISA to Control Your USB Device Watch a 3 minute video on Getting Started with Instrument Control using USB This section walksthrough the steps for configuring a USB RAW device to be controlled by NI-VISA 5.0 on a Windows-based computer. If you are using a USBTMC-compatible device, connect your device and skip to the third step, Test the device with NI-VISA Interactive Control. At this point, NI-VISA already should be installed on your computer, and your USB device should not be connected. Furthermore, you should not havea driver for your USB device installed. There are three steps to configure your USB device to use NI-VISA: 1. Create the INF file using the Driver Development Wizard. 2. Install the INF file and the USB device using the INF file. 3. Test the device with NI-VISA Interactive Control. For the purposes of this tutorial, a Creative Webcam is used as an example USB device and is installed on a Windows7 system. Because this tutorial is intended to explain the configuration of a generic USB device, details specific to the Creative Webcam are not discussed. 2.1. Create the INF File Using the Driver Development Wizard To use NI-VISA, you must first tell Windows to use NI-VISA as default driver for the device. In the Windows environment, you can do this with an INF file. NI-VISA 3.0 and higher...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Ingeniero
  • Ingeniero
  • Ingeniero
  • Ingeniero
  • Ingeniero
  • Ingeniero
  • Ingeniero
  • Ingeniero

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS