The GP Interface Bus: in This Chapter..
The GP Interface Bus: in This Chapter..
In this chapter...
Objectives
When you finish reading this chapter, you should be
able to:
Prerequisites
BT-BASIC Programming
06/2003
5-1
Introduction to the
System Interface
Buses
Function
Description
Listener
Talker
Controller
Table 5-1
BT-BASIC Programming
5-2
The GPIB
Statements
Statement
Description
assign to
enter and
enter using
output and
output using
BT-BASIC Programming
5-3
Table 5-3
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.
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
spoll
srq
timeout
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
PARAMETERS
BT-BASIC Programming
5-5
Example 5-1
Dedicated Device
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
ps0
16
22
ps1
17
23
BT-BASIC Programming
5-6
Table 5-4
Dedicated Device
GPIB Address
Hex
Decimal
ps2
18
24
ps3
19
25
ps4
1A
26
ps5
1B
27
ps6
1C
28
ps7
1D
29
ps8
ps9
ps10
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.
BT-BASIC Programming
5-7
A Reference
Description of the
GPIB
BT-BASIC Programming
5-8
Figure 5-1
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
BT-BASIC Programming
5-9
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
DAV
Data Valid
NRFD
NDAC
BT-BASIC Programming
Table 5-6
Line
Description
ATN
Attention
IFC
Interface Clear
5-10
Table 5-6
Line
Description
REN
Remote Enable
EOI
End or Identify
SRQ
Service Request
Table 5-7
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
Table 5-7
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.
BT-BASIC Programming
5-12