Download local copy

Transcript
Data and Command Messages
In a classroom, when the instructor tells the students who is the Talker and who are the Listeners, his or her information
is a command—not the actual data information that the instructor will send. On the GPIB, this distinction is not so
intuitive. The bus management line, ATN, determines what type of message you are sending on the bus. If this line
is unasserted, the information on the bus is a data message; if this line is asserted, the information is a command
message from the Controller to all devices. The devices on the GPIB monitor the ATN line, determine the data type,
and treat the data appropriately.
GPIB Addressing Protocol
In a classroom, an instructor either speaks to the entire class or to a particular student. To speak to a student, the
instructor first addresses that student by name.
Addressing on the GPIB follows the same idea. Before any communication can take place on the bus, you must address
the Talker and Listener. Before any data passes between devices, the Controller determines who talks and who listens.
In the classroom, we address people by their names. However, on the GPIB, each device (including the Controller)
has a unique primary GPIB address in the range of 0 to 30 (decimal). The Controller places a command message specifying the addresses of the Talker and Listener devices on the bus.
The Controller sends a single byte (8 bits) of information for a Talker or Listener address command message. Address
command messages have the following format:
Bit
7
Data
6
5
TA LA
4
3
2
1
0
X
X
X
X
X
Bits 0 through 4 contain the binary GPIB primary address of the device in communication, and either bit 5—Listener
Address (LA)—or bit 6—Talker Address (TA)—will be set if the device is a Talker or a Listener. Bit 7 is never used
and is considered a don’t care bit. For simplicity, assume bit 7 is zero.
Consider an example in which a Controller at primary GPIB address 0 talks to a device at primary GPIB address 1. To
establish the communication link, the Controller must send its GPIB talk address and the device's listen address over
the GPIB. In this example, these addresses are as follows:
Bit Patterns Sent to Set Up Talker
Bit pattern:
Hexadecimal value:
01000000
010
00000
TA
ADR
0100
0000
4
0
20
Talker's GPIB Address is 0
Hex 40 = ASCII "@"