What Is GPIB?
什么是GPIB
Hewlett Packard developed the General Purpose Interface Bus, or GPIB, in the late 1960s to facilitate communication between computers and instruments. A bus is simply the means by which computers and instruments transfer data, and GPIB provided a much-needed specification and protocol to govern this communication. The Institute of Electrical and Electronic Engineers (IEEE) standardized GPIB in 1975, and it became known as the IEEE 488 standard (GPIB = IEEE 488). GPIB's original purpose was to provide computer control of test and measurement instruments. However, its use has expanded beyond these applications into other areas, such as computer-to-computer communication and control of multimeters, scanners, and oscilloscopes.
Hewlett Packard在60年代末发明了通用接口总线,或简称为GPIB,使得在电脑和仪器之间的通信得以轻松实现。总线并不是简单的指在电脑和仪器间传输数据,GPIB提供了一种非常必要的规范和协议来管理通信。IEEE协会在1975年定立了GPIB标准,作为IEEE第488个标准,GPIB变得十分著名。GPIB的最初目的是提供电脑对仪器在检验测量时的控制。然而,它的用途被延伸至很多其它领域中,比如电脑到电脑的通信,万用表、扫描仪、示波器的控制。
GPIB is a parallel bus that many instruments use for communication. GPIB sends data in bytes (one byte = eight bits), and the messages transferred are frequently encoded as ASCII character strings. Your computer can only perform GPIB communication if it has a GPIB board (or external GPIB box), such as those shown in Figure 2.3, and the proper drivers installed.
GPIB可以用作多台仪器通信的平行总线。GPIB以比特传输数据(1比特是8字节),采用ASCII码字符串编码信息。你的电脑只有安装了GPIB板(或者GPIB扩展板)才可以使用GPIB,这些器材如下图所示。
Figure 2.3. GPIB boards from NI

You can have many instruments and computers connected to the same GPIB bus. Every device, including the computer interface board, must have a unique GPIB address between 0 and 30, so that the data source and destinations can be specified by this number. Address 0 is normally assigned to the GPIB interface board. Instruments connected to the bus can use addresses 1 through 30. The GPIB has one Controller, usually your computer, that controls the bus management functions. To transfer instrument commands and data on the bus, the Controller addresses one Talker and one or more Listeners. The data strings are then sent across the bus from the Talker to the Listener(s). The LabVIEW GPIB VIs automatically handle the addressing and most other bus management functions, saving you the hassle of low-level programming. The following illustration shows a typical GPIB system (see Figure 2.4).
你可以将许多仪器和电脑连接到同一个GPIB总线上。每一个设备,包括电脑接口板,必须有一个唯一的GPIB地址(0到30之间),这样数据源和目的地址就可以用这个数字来识别了。通常地址0会被分配给GPIB接口板。连接到接口板上的仪器可以选用地址1到30中的任一个。GPIB有一个控制器,通常是你的电脑,用来控制总线管理功能。为了在总线上传输仪器命令和数据,控制器给一个呼叫口和一个或几个响应口分配地址。然后数据串在总线上从呼叫口被发送到响应口。GPIB VI自动处理地址分配和大部分其它的总线管理功能,为你的低水平设计提供方便。下图展示了一个典型的GPIB系统(图2.4)。
Figure 2.4. Typical GPIB system containing one or more GPIB enabled instruments and a GPIB controller board

Although using GPIB is one way to bring data into a computer, it is fundamentally different from performing data acquisition, even though both use boards that plug into the computer. Using a special protocol, GPIB talks to another computer or instrument to bring in data acquired by that device, while data acquisition involves connecting a signal directly up to a computer's DAQ device.
虽然GPIB是一种将数据导入电脑的方法,但是即使是它与嵌入到电脑里的板块配合使用,GPIB在根本上也不同于数据采集。使用一个特别的协议,GPIB与另外的电脑或者仪器实现对话,将它们采集到的数据导入本电脑中,而涉及直接连接信号的数据采集则由电脑的DAQ设备负责。
To use GPIB as part of your virtual instrumentation system, you need a GPIB board or external box, a GPIB cable, LabVIEW and a computer, and an IEEE 488-compatible instrument with which to communicate (or another computer containing a GPIB board). You also need to install the GPIB driver software on your computer as well, according to the directions that accompany LabVIEW or the board.
使用GPIB作为你最终仪器系统的一部分,你需要一个GPIB板或者外接盒,一条GPIB电缆,LABVIEW,一台电脑,一个IEEE 488-兼容仪器来通信(或者另一台带有GPIB板的电脑)。你同样需要在你的电脑里安装GPIB驱动软件,依照你是与LabVIEW配合还是与板块配合,安装相应的驱动。
LabVIEW's GPIB VIs communicate with National Instruments' GPIB boards, but not those from other manufacturers. If you have another vendor's board, you can either get driver software from them (if it's available) or write your own driver code and integrate it into LabVIEW. As with DAQ drivers, it's not an easy thing to do!
We'll talk more about DAQ and GPIB in Chapters 10, "Signal Measurement and Generation: Data Acquisition," 11, "Data Acquisition in LabVIEW," and 12, "Instrument Control in LabVIEW."



