Exercise 5b

Exercise 5b - Exercise 5b: Using the GPIB to communicate...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Exercise 5b: Using the GPIB to communicate with the Tektronic TDS210 digital oscilloscope In this exercise you will learn how to directly record an oscilloscope trace using a C++ program and the GPIB. The GPIB (General Purpose Interface Bus) is a hardware architecture designed to support computer connectivity with many different devices from a wide range of manufacturers. GPIB (architecture designated as IEEE 488) is not a direct data acquisition system, like the NI 6221 board, but a 24-bit data-way that allows lab instrument control and communication. GPIB is an industry standard. Hewlett Packard designed the architecture in the late 1960’s exclusively for HP instrument interconnectivity, called then HP-IB. However, with increasing numbers of digital controllers and programmable lab instruments in the market place, a standard instrument interface data-way was needed. So, in 1975, IEEE 488-1975 was announced, followed by various changes in the hardware and software standard; the last change was IEEE 488.2 in the early 1990's. The hardware on your computer necessary for use of the GPIB to communicate with GPIB devices (e.g., the Tektronix TDS210 digital oscilloscope) is a National Instruments NI-GPIB card. Such GPIB cards are available from a wide range of vendors (e.g., Agilant, National Instruments, Keithley, IOtech, CIC, etc.). You will be using the NI-GPIB card and associated software to capture a trace from the oscilloscope and display it in MATLAB. GPIB specifics: A 24 bit bus: 1) 8 parallel data bits 2) 5 device interaction bits 3) 3 handshaking bits 4) 8 ground bit The native C functions you will be using to communicate with the GPIB hardware are part of the National Instruments NI-488.2 driver set. For each GPIB vendor, there is a different set of functions to communicate with the GPIB card, but all vendors’ function sets are similar, so it is relatively simple to program one or another. Programming 1) To use GPIB native C functions, National Instruments supplies the header file “ni488” that contains all GPIB function headers. This must be included in any GPIB C++ program.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2) Most function calls (excluding ibfind and ibdev) return an integer that is status code. The status code returns a zero if the function was successful and a non-zero number if there was an error. Many status codes are not in a reference table and just mean something went wrong. For this exercise the basic commands for oscilloscope data I/O you will use are: ibrd, ibwrt, ibclr, ibdev There are numerous other commands that we won’t need here; most of these are for arming and triggering GPIB devices and more complicated software routines. To open a connection to your oscilloscope, first use ibdev to give the device an identifying number. ibdev requires the arguments (board index, primary instrument address, secondary instrument address, I/O wait time (a code value of 12 (3 s) is appropriate), EOI (end or identify) mode, EOI character). There can be up to 15 devices in a daisy chain connected to one controlling
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/20/2009 for the course AEP 2640 at Cornell.

Page1 / 7

Exercise 5b - Exercise 5b: Using the GPIB to communicate...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online