1 / 28

Lesson 9 Instrument Control

Lesson 9 Instrument Control. Introduction GPIB Serial Using Other Interfaces Software Architecture. Instrument I/O Assistant VISA Instrument Drivers. A. Introduction to Instrument Control.

callia
Télécharger la présentation

Lesson 9 Instrument Control

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lesson 9Instrument Control • Introduction • GPIB • Serial • Using Other Interfaces • Software Architecture • Instrument I/O Assistant • VISA • Instrument Drivers

  2. A. Introduction to Instrument Control • When you use a PC to automate a test system, you are not limited to the type of instrument you can control • You can mix and match instruments from various categories • The most common categories are GPIB, serial, modular instruments, and PXI modular instruments • You must understand properties of the instrument, such as the communication protocols to use

  3. B. GPIB • GPIB (general purpose interface bus) is a standard interface for communication between instruments and controllers from various vendors

  4. B. GPIB • The bus supports one system controller, usually a computer, and up to 14 additional instruments • Controller: • Defines the communication links • Responds to devices that request service • Sends GPIB commands • Passes/receives control of the bus

  5. B. GPIB – Data Transfer Termination • Informs listeners that all data has been transferred • Terminate the following ways: • Assert the End Or Identify (EOI) hardware line with the last data byte - preferred method • Place a specific end-of-string (EOS) character at end of data • Allow the listener count the bytes transferred by handshaking and stop reading when the listener reaches a byte count limit

  6. B. GPIB – Data Transfer Rate • To achieve the high data transfer rate that the GPIB was designed for: • Limit the number of devices on the bus • Limit the physical distance between devices • You can obtain faster data rates with HS488 devices and controllers

  7. C. Serial • Serial communication • Transmits data between a computer and a peripheral device, such as a programmable instrument or another computer • Uses a transmitter to send data one bit at a time over a single communication line to a receiver • Best method when data transfer rates are low, or you must transfer data over long distances • Most computers have one or more serial ports, so you do not need any extra hardware other than a cable

  8. C. Serial • A character frame packages each transmitted character as a single start bit followed by the data bits

  9. C. Serial – RS-232 Standard • Used historically for connecting a mouse, printer, or modem • Used for industrial instrumentation • Limited to point-to-point connections between PC serial ports and devices

  10. C. Serial – RS-422 Standard • Uses a differential electrical signal as opposed to the unbalanced (single-ended) signals referenced to ground with RS-232 • Differential transmission, which uses two lines each to transmit and receive signals, results in greater noise immunity and longer transmission distances as compared to RS-232

  11. C. Serial – RS-485 Standard • Variation of RS-422 • Allows you to connect up to 32 devices to a single port and define the necessary electrical characteristics to ensure adequate signal voltages under maximum load • Can create networks of devices connected to a single RS-485 serial port • Good choice in industrial applications that require many distributed devices networked to a controller

  12. D. Using Other Interfaces • Several devices communicate with serial or GPIB instruments through the Ethernet, USB, or IEEE 1394 (FireWire) ports and bypass the need for a serial port or GPIB board on your computer • When using these devices, program them just as you would if they were using the serial port or a GPIB board

  13. E. Software Architecture • Interface Drivers: Instrument interfaces such as GPIB include a set of drivers for the interface • Configuration: Use MAX to configure the interface • Application: VISA is a common API to communicate with the interface drivers and is the preferred method used when programming for instrument control in LabVIEW • Instrument Drivers: An instrument driver is a set of VIs specially written to communicate with an instrument

  14. Exercise 9-1: GPIB Configuration with MAX • Concept Exercise • Learn to configure the NI Instrument Simulator and use MAX to examine the GPIB interface settings, detect instruments, and communicate with an instrument.

  15. F. Instrument I/O Assistant

  16. Instrument I/O Assistant • To configure the Instrument I/O Assistant.

  17. Exercise 9-2: Instrument I/O Assistant • Concept Exercise • Configure a serial or GPIB instrument and communicate with the instrument using the Instrument I/O Assistant.

  18. G. VISA • Virtual Instrument Software Architecture (VISA): • Lower layer of functions in the LabVIEW instrument driver VIs that communicate with the driver software • High-level API that calls low-level drivers • Can control VXI, GPIB, serial, or computer-based instruments and makes the appropriate driver calls depending on the type of instrument used • If you choose not to use the Instrument I/O Assistant to automatically generate code for you, you can use VISA functions instead to communicate with the instrument

  19. G. VISA – Programming Terminology • Resource— Any instrument in the system, including serial and parallel ports • Session— When you open a session to a resource, LabVIEW returns a VISA session number, which is a unique refnum to that instrument • Instrument Descriptor—Specifies the interface type (GPIB, VXI, ASRL), the address of the device, and the VISA session type (INSTR or Event)

  20. G. VISA – Serial • The VISA Configure Serial Port VI initializes the port identified by VISA resource name to the specified settings

  21. Exercise 9-3: VISA Write and Read VI • Concept Exercise • Communicate with a serial or GPIB interface to an instrument using VISA functions.

  22. H. Instrument Drivers • When you use an instrument driver, the driver contains the code specific to the instrument • If you change instruments, replace the instrument driver VIs with the instrument driver VIs for the new instrument, which greatly reduces your redevelopment time

  23. H. Instrument Drivers – What Are They? • A LabVIEW Plug and Play instrument driver is a set of VIs that control a programmable instrument • Each VI corresponds to an instrument operation, such as configuring, triggering, and reading measurements from the instrument • Instrument drivers help you get started using instruments from a PC, and save you development time and cost because you need not learn the programming protocol for each instrument

  24. H. Instrument Drivers – Where are they? • You can locate most LabVIEW Plug and Play instrument drivers in the Instrument Driver Finder • Access within LabVIEW by selecting Tools» Instrumentation»Find Instrument Drivers or Help»Find Instrument Drivers • Connects you with ni.com to find instrument drivers • When you install an instrument driver, an example program using the driver is added to the NI Example Finder

  25. H. Instrument Drivers – Example

  26. Exercise 9-4: NI Devsim VI • To install an instrument driver and explore the example programs that are installed with the driver.

  27. Which instrument interfaces can you use to communicate with the instrument using VISA? Serial DAQ GPIB Ethernet What API does the Instrument I/O Assistant use? C Visual Basic VISA NI-DAQmx Summary—Quiz

  28. Which of the following is a way to inform listeners that all data has been transferred? Asserting the End or Identify (EOI) line. Placing a end-of-string (EOS) character at the beginning of the data being transferred. Using the VISA Close function. Turning off the power to the controller. Summary—Quiz

More Related