0% found this document useful (0 votes)
61 views

The GP Interface Bus: in This Chapter..

tbas

Uploaded by

SniderNava
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views

The GP Interface Bus: in This Chapter..

tbas

Uploaded by

SniderNava
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

5

In this chapter...

The GP Interface Bus

Introduction to the System Interface Buses, 5-2

The GPIB Statements, 5-3

Addressing the Bus And Bus Devices, 5-5

A Reference Description of the GPIB, 5-8

Objectives
When you finish reading this chapter, you should be
able to:

Understand the General Purpose Interface Bus


(GPIB)

Prerequisites

There are no prerequisites associated with using


this chapter.

Required Tools and Materials

Agilent Technologies 2001, 2003

There are no required tools or materials associated


with using this chapter.

BT-BASIC Programming
06/2003

5-1

Chapter 5: The GP Interface Bus

Introduction to the
System Interface
Buses

The test system can be interfaced to busable instruments


and devices via the General Purpose Interface Bus
(GPIB).

The GPIB Bus

Function

Description

Listener

A device capable of receiving data from


other devices on the bus. A listener might be
a printer, a programmable power supply, etc.

Talker

A device capable of transmitting data to


other devices on the bus. A talker might be a
voltmeter or a counter.

Controller

A device capable of managing


communications over the GPIB. This control
includes such things as addressing, and
ending commands. In the test system, only
the workstation is capable of this function. So
for the remainder of this chapter, when we
say controller we are referring to the
workstation's function as an GPIB controller.

The GPIB bus is used for communication between the


workstation and:

DUT power supplies in the testhead,

Any optional DUT power supplies in the support


bay, and

Any optional instrument accessories.

Device Functions on the GPIB


Devices on the GPIB (Table 5-1)communicate by way
of three basic functions, and each busable device is
equipped with the hardware and firmware necessary to
carry out one or more of these functions

Table 5-1

Device functions on the GPIB

Be aware that some devices on the bus may be able to


function only as listeners, or only as talkers, while other
devices may be equipped to function as both.

Agilent Technologies 2001, 2003

BT-BASIC Programming

5-2

Chapter 5: The GP Interface Bus

The GPIB
Statements

As a test system user, your interaction with GPIB is


through BT-BASIC statements which either transfer
data via the bus or directly manipulate operation of the
bus. Both types of statements are described below.

GPIB-specific tasks. If you need to know more about


the data and control lines these statements manipulate,
refer to A Reference Description of the GPIB on
page 5-8.

General Purpose I/O Statements Used With GPIB

The dedicated GPIB statements are described in Table


5-3 on page 5-4.

Some of the general purpose BT-BASIC I/O statements


described in Chapter 4, Input / Output can be used to
communicate with devices on the GPIB bus. These
statements are described in Table 5-2.
Table 5-2

I/O statements used with GPIB

Statement

Description

assign to

Assigns an @<name> (at-name) to the


bus or to a device. Enables sequential
access.

enter and
enter using

Inputs data from devices

output and
output using

Outputs data to devices

The Dedicated GPIB Statements


BT-BASIC also contains several statements, referred to
as dedicated GPIB statements, which perform

Agilent Technologies 2001, 2003

BT-BASIC Programming

5-3

Chapter 5: The GP Interface Bus

Table 5-3

Dedicated GPIB statements

Statement

Description

abort

Clears the bus to its initial state by activating IFC for at least 100 microseconds. Also clears ATN and sets
REN.

clear

If the bus is addressed, issues device clear (DCL). If a device is addressed, issues selected device
clear (SDC).

local

Sends go to local (GTL) to a selected device, or clears REN if the bus is addressed.

local lockout Sends local lockout (LLO) to the bus and prevents any device from being operated locally.

Agilent Technologies 2001, 2003

ppoll

Conducts a parallel poll on the bus and returns the result as a function value.

remote

Sets the Remote ENable line (REN) to 1. If a device is addressed, the device is also addressed to listen.

send

Sends commands and data directly to the bus.

spoll

Conducts a serial poll for a specific device on the bus.

srq

Returns the current value (0 or 1) of the SRQ line.

timeout

Sets timeout for a bus or device.

trigger

Issues Group Executive Trigger (GET) which triggers devices to start their (device-dependent)
activities. If the bus is addressed, all current listeners are triggered. If a device is addressed, just that device is
triggered.

BT-BASIC Programming

5-4

Chapter 5: The GP Interface Bus

Addressing the Bus


And Bus Devices

Because the GPIB and the devices connected to it are


part of the file system, they are addressed as if they were
files.
Either a <file id> or an @<name> can be used to
address the bus or a device on the bus. Using @<name>'s
is generally preferred because it is faster and because
the device remains open and can be accessed
sequentially.
When the GPIB is installed, it is associated with a file in
the /dev directory. The file name for a GPIB interface is
/dev/hpibx, where x is the number of the GPIB bus.
Because the GPIB is bus #1, its associated file is
/dev/hpib1.

PARAMETERS

<GPIB> addresses an entire bus. The file name is


/dev/hpibx, where x is the number of the bus.

<GPIB device> is the file name to address a


specific device on a bus. When a device is
addressed, the following sequence of commands
is sent on the bus:

Unlisten the GPIB.


Address system controller to listen or talk.
Address device to talk or listen.

How Specific Devices are Addressed


The syntax of an GPIB bus address, shown below,
includes two levels of bus addressing: the complete bus,
and an individual device on the bus. Be aware that not
all GPIB statements can address both levels.
SYNTAX
<GPIB>
<GPIB device>
<GPIB> and <GPIB device> can be:
<file id>
@<name>
<file id> is a <string expression>
<name> is a <label>

Agilent Technologies 2001, 2003

BT-BASIC Programming

5-5

Chapter 5: The GP Interface Bus

Example 5-1

Example of addressing specific devices

clear "/dev/hpib1"! Clears GPIB bus #1


msi "/dev"
assign @DVM to "dvm1"! Assigns @<name> to the DVM on bus #1
remote @DVM
trigger @DVM | enter @DVM; Voltage

Reserved GPIB Addresses and Device Names


Addresses and device names on the system dedicated
bus are reserved and cannot be assigned to any other
instrument, even if there is no instrument at a particular
Table 5-4

Reserved GPIB addresses and device names

Dedicated Device

Agilent Technologies 2001, 2003

address. If these addressing requirements are not


adhered to, the test results can be unpredictable. The
reserved addresses and device names are shown in
Table 5-4.

File name (/dev/...)

GPIB Address
Hex

Decimal

Miscellaneous GPIB #1

hpib1

1F

31

Oscilloscope

scope

HP 3488A

hp3488

Voltmeter

dmm

10

Reference Voltmeter

dmm_ref

11

Synthesizer

synth

11

17

Module 0, ASRU Card channels 1-4

ps0

16

22

Module 1, ASRU Card channels 1-4

ps1

17

23

BT-BASIC Programming

5-6

Chapter 5: The GP Interface Bus

Table 5-4

Reserved GPIB addresses and device names (continued)

Dedicated Device

File name (/dev/...)

GPIB Address
Hex

Decimal

Module 2, ASRU Card channels 1-4

ps2

18

24

Module 3, ASRU Card channels 1-4

ps3

19

25

Module 0, ASRU Card channel 5 or 5-6

ps4

1A

26

Module 0, ASRU Card channel 6

ps5

1B

27

Module 1, ASRU Card channels 5-6

ps6

1C

28

Module 1, ASRU Card channel 6

ps7

1D

29

Module 2, ASRU Card channels 5-6

ps8

Module 2, ASRU Card channel 6

ps9

Module 3, ASRU Card channels 5-6

ps10

Module 3, ASRU Card channel 6

ps11

NOTE
If a power supply is split between modules, use
the device file and GPIB address appropriate for
the connections in the lower-numbered module.

Agilent Technologies 2001, 2003

BT-BASIC Programming

5-7

Chapter 5: The GP Interface Bus

A Reference
Description of the
GPIB

Even though communication over the GPIB is normally


handled through BT-BASIC statements, it may be
helpful for you to understand how the individual bus
lines function. The following paragraphs provide an
overview of the GPIB. For more detailed information on
bus communications, see the IEEE Publication on bus
communication standard 488-1978.
The GPIB uses a 24-conductor cable to interconnect
several devices in parallel. Eight of the lines are used as
grounds, and sixteen are responsible for bus
communications and control. The sixteen lines that
carry information are usually the only communication
link between the interconnected instruments. Eight of
these lines transmit data and the other eight are
responsible for timing and for control of data transfers.
Negative logic (low true) is used on all sixteen of the
lines. The data and control lines are illustrated in Figure
5-1 on page 5-9.

Agilent Technologies 2001, 2003

BT-BASIC Programming

5-8

Chapter 5: The GP Interface Bus

Figure 5-1

GPIB bus structure


Device A

Data Bus

Data Lines

Device B

Data Byte
Transfer Control

Handshake
Lines

Device C

General Interface
Management
Device D

Control
Lines

D1/0 . . . 8
DAV
NRFD
NDAC
IFC
ATN
SRQ
REN
EO1

Agilent Technologies 2001, 2003

BT-BASIC Programming

5-9

Chapter 5: The GP Interface Bus

The Data Lines


Data is transmitted on the eight data lines (DIO-1
through DIO-8) as a series of eight-bit bytes. Seven of
the eight bits represent an ASCII character, with the
eighth bit available as a parity bit. Each data byte
transfer is accomplished with an interlocked handshake
technique which is controlled via the DAV, NRFD, and
NDAC control lines.

The Handshake Control Lines


Three handshake control lines are used to control
asynchronous data byte exchanges so that a talker will
not send data faster than each of the listeners can accept
it. The three handshake control lines are described in
Table 5-5.
Table 5-5

Handshake control lines

When the talker senses that the NRFD line has floated
high, it places a data byte on the data lines and pulls the
DAV line low. This action indicates to the listeners that
the data byte on the data lines is valid and can be read.
Each listener, operating at its own speed, then reads the
data and lets the NDAC line go high.
Only when all listeners have let the NDAC line float
high will the talker sense that the data has been
accepted. The talker can then let the DAV line go high to
start the entire sequence over again and send the next
byte of data.

Line

Description

The Bus Management Lines

DAV

Data Valid

NRFD

Not Ready For Data

The five remaining lines are responsible for bus


management. They are described in Table 5-6.

NDAC

Not Data Accepted

Using these three lines, a typical data exchange between


instruments proceeds as follows. All devices currently
designated as active listeners indicate (via the NRFD
line) when they are ready to accept data. A device that is

Agilent Technologies 2001, 2003

not ready to accept data forces the NRFD line low


(true), while a device that is ready for data allows the
line to float high. Because the devices on the bus are
wired in parallel, the device(s) pulling the line low
override its floating high. This line remains low until all
active listeners are ready to accept data.

BT-BASIC Programming

Table 5-6

Bus management lines

Line

Description

ATN

Attention

IFC

Interface Clear

5-10

Chapter 5: The GP Interface Bus

Table 5-6
Line

Description

REN

Remote Enable

EOI

End or Identify

SRQ

Service Request

Telling devices if the information on the bus is


data or a command

Telling devices when a data byte on the bus is the


last one of a data message

The bus management lines take care of bus protocol by:

The handshake control lines function interactively to


accomplish a data byte or a command byte exchange on
the data bus. By comparison, the bus management lines
act independently of each otherthat is, each bus
management line's function is specialized.

Clearing the GPIB to allow servicing of bus


interrupts

Table 5-7 contains a brief explanation of the function of


each of the management lines.

Table 5-7

Agilent Technologies 2001, 2003

Bus management lines (continued)

Bus management line function

Line

Function

ATN (Attention)

Since both addressing information and data messages are sent over the same set of data lines, the ATN
line is used to distinguish one from the other. When the ATN line is false, the eight-bit byte on the data bus
is interpreted as a character in the data message. When the ATN line is true (low), the byte is interpreted
as control or addressing information.

IFC (Interface
Clear)

Only the system controller can control the IFC line. When the IFC line is pulled low, all bus activity is
unconditionally terminated, and the system controller takes control of the bus. Any current talker and
listeners become unaddressed. Normally, this message is used only to abort an unwanted operation, or to
allow the controller to regain control of the bus when something has gone wrong.

BT-BASIC Programming

5-11

Chapter 5: The GP Interface Bus

Table 5-7

Bus management line function (continued)

Line

Function

REN (Remote
Enable)

The REN line is used to allow instruments on the bus to be remotely programmed by the controller. Many
GPIB instruments, such as digital voltmeters, can have various functions and ranges selected either
locally by manipulating their front panel controls, or remotely by programming messages sent over the
bus from the system controller. In order to remotely program an instrument that has both local and remote
programming capability the REN line must be set. This enables the instrument to accept data from the
data bus if it has been addressed to do so.

EOI (End Or
Identify)

Under normal conditions, the data sent to instruments over the bus are in ASCII format. At the end of an
ASCII message, the linefeed character (LF = decimal 10) indicates the end of the data message. If a
device wishes to send data in eight-bit bytes which represent general binary patterns (not ASCII
characters), then the EOI line is used to mark the end of the data message. When a listener detects that
the EOI line is set, it recognizes that the data byte on the bus is the last one in the data message.

SRQ (Service
Request)

The controller is always in charge of the order of events on the GPIB. If a particular instrument on the bus
has information of which the controller should be aware, it can pull the SRQ line low to ask for the
controller's attention. This action represents a request for attention from the controller and not a demand.
The controller determines when and how it will handle an SRQ.

The instrument originating the service request will


continue to do so until the request has been satisfied.
What satisfies the SRQ for a particular instrumenta
voltmeter, counter, etc.can be found in the operating
documentation for that instrument.

Agilent Technologies 2001, 2003

BT-BASIC Programming

5-12

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy