Easy-to-understand overview of GPIB communication, explanation of terminology, and basic knowledge regarding GPIB required for programming.
GPIB (General Purpose Interface Bus) was developed as an interface between computers and measuring instruments. It is mainly used to connect PCs and measuring instruments. GPIB was created as HP-IB, an in-house standard developed by Hewlett Packard, which was approved by the IEEE (Institute of Electrical and Electronics Engineers) and became an international standard. Many current measuring instruments support the GPIB interface as standard, and it is widely used in measurement systems using PCs and measuring instruments.
GPIB standards include IEEE-488 and the higher-level protocol IEEE-488.2, which is currently mainstream. In addition to the transfer methods specified in IEEE-488, IEEE-488.2 features syntax for text data and numeric expressions, and commands and queries that can be used by all instruments. IEEE-488.2-compatible instruments can communicate with other IEEE-488.2-compliant devices and with IEEE-488 devices within the scope prescribed in IEEE-488.
See all GPIB communication devices
Piggy back connector
The reason why the GPIB interface is still used in many measuring instruments and has been able to establish itself as the standard bus of the measuring instrument industry is due to the many advantages offered by connecting GPIB devices to a PC.
A common system setup involves connecting multiple measuring instruments to a single PC and configuring each instrument to perform automatic measurement according to a program. The acquired measurement data is then collected by the PC for analysis and display, and data retention.
Example system of GPIB communication devices connected to a PC
Due to GPIB communication limitations (overall cable length of whole system), system must be operated and observations must be made near the telescope, which is inconvenient. Many researchers requested the ability to share information in real time.
At CONTEC, we can use our extensive experience in developing measurement and control equipment and network devices to solve problems like these.
The GPIB standard limits the number of devices that can be connected in a single system to 15 including the controller. It is not possible to connect more than this number of devices in a single system.
There is a high degree of freedom in device connection methods, and devices can be connected in a daisy chain or star arrangement, or in a combination of the two. Devices must not be connected in a loop arrangement.
Daisy chain connection
Star connection
Caution: Devices must not be connected in a loop arrangement.
Cables between devices may be up to 4 m long. The maximum cable length that can be used to connect devices to each other in a single system is 2 m x no. of devices or 20 m, whichever is shorter.
GPIB uses eight data lines to transfer 1 byte of data at a time at a speed of up to 1 MB/s. However, many measuring instruments have a slow communication speed, and the communication speed of devices connected on the same bus will be limited to that of the slowest device.
Of the devices connected on a bus, devices that receive data are called "listeners," while devices that send data are called "talkers."Talkers and listeners are specified by the controller. The device that manages the whole system is called the "controller", which is normally a computer (PC).
As the name suggests, the master is the device that has the power to make decisions regarding GPIB communication (command transmission, etc.,) while the slave must obey instructions issued by the master (command receipt, etc.) When configuring a system there must be one master and at least one slave. When controlling a measuring instrument, the PC acting as the controller is the master.
Each device connected to a GPIB system has a unique address within the system that is used to identify it. (A user-assigned address is called "my address.")A device address in a GPIB system is analogous to a phone number in the telephone system, and communication is achieved by sending and receiving data to or from the device with this number.Device addresses for the same system can be set freely from 0 to 30, but must not overlap with other addresses.
A handshake is a communication method wherein a signal is sent from the sender to the receiver saying, "I'm sending data." On receiving this signal, the receiver reads data from signal lines and then sends a signal back to the sender saying, "I received the data you sent". By repeating this process, the sender and receiver transfer data while checking that it is being sent and received. Handshake communication allows GPIB to achieve highly reliable data transmission.
To prevent data from colliding, the number of devices on a GPIB bus line that can send data at any point in time is restricted to one. The device that achieves this is the controller. The controller mainly performs the operations below. If these operations are expressed in a program, it is possible to build a GPIB system that has a PC as a controller.
GPIB signal lines are comprised of eight data lines, three handshake lines, and five management lines. Connector pin assignments are standardized as shown in the pinout below.It is especially important to understand the role of the management bus lines that are required when putting together a GPIB program.
GPIB connector pinout
Management bus lines are used to efficiently control each device connected to the bus line, and manage the flow of information. They play an important role in controlling GPIB devices.
Data lines are used for sending multiline messages and for transferring data.
Signal lines other than data lines all consist of a ground line and a twisted pair. Cables and connectors used in GPIB applications are shielded, and provide excellent noise resistance.
These lines are used for data line handshakes.
To control GPIB devices via a program and receive data, having an understanding of how SRQ (service requests) and polling work in addition to how management bus lines operate, will allow you to create efficient programs.
SRQ is a function that allows a device to send an interrupt request to the controller to let it know that an error has occurred or that the device is ready to send, and so on. If an SRQ request occurs, the SRQ line switches to true, which tells the controller that a device connected to the bus is requesting a service. However, as the controller cannot know which device sent the request based solely on the SRQ request, it conducts a poll to identify the device requesting the service and check the content of the request.
Serial poll is a method whereby the controller transmits an SRQ signal serially to query each device that may be requesting a service. Polled devices send a single byte of data called a "status byte" to the controller. The controller examines the status byte of each device to determine which devices have requested a service and what kind of service they have requested. Serial polls are generally the most common type of poll used.
Parallel poll is a method whereby each of the eight data lines is assigned to a single device so that the controller can instantaneously determine which (of the maximum eight) devices have transmitted the SRQ signal. When a parallel poll is executed, each device transmits a 0 or 1 on its assigned data line to tell the controller whether or not it requested the service.
Status bytes (single bytes) are output via data lines in the same way as sent and received data. When a device issues an SRQ, the 6th bit of the status byte switches to 1 (true); it switches to 0 (false) if the device is not issuing an SRQ. The remaining bits of the status byte are able to have device-dependent meanings. For example, they can notify the controller of the cause of the SRQ (measurement completed, error occurred, etc.) After being polled by the controller, the 6th bit of the status byte is reset to 0.
The GPIB standard separates the functions of applicable devices into interface functions and device functions. Only interface functions are specified in the standard. However, devices connected to a GPIB system do not need to have all functions implemented.
Structure of GPIB-equipped device
GPIB includes a variety of standardized messages and commands, which are used to control GPIB communication devices.
Multiline interface messages are messages (commands) that are specified by the standard for operating devices connected via GPIB. They can only be handled by the controller, and are sent using data lines (x8). Multiline interface commands include address commands and universal commands.
Device messages are messages that are not directly related to GPIB interface functions. Examples include messages regarding measurement data such as voltages measured by a measuring instrument, and measuring instrument settings. Device messages are sent from a device that has a talker function, and are received by devices that have a listener function.
Uniline messages are messages that carry meaning in a single signal line. When the line is becomes true, the command starts, and when it becomes false, the command ends.
Address commands are standardized GPIB commands only used with specific devices.
Universal commands are standardized GPIB commands used with all connected devices.
Shared commands are commands that can also be used with IEEE-488.2-compliant devices. They can control GPIB communication devices efficiently. Shared IEEE-488.2 commands and queries include *RST, *CLS, *TRG, and *IDN?
To PageTop