Chapter 5 Programming Considerations
© National Instruments Corporation 5-7 GPIB-1014 User Manual
Address Mode 2
Address Mode 2 is used when Talker Extended (TE) or Listener Extended (LE) functions are to
be used. TE and LE functions require receipt of two addresses (primary and secondary) before
setting TA or LA. The TLC GPIB primary address is indicated by the byte written to ADR0.
The secondary address is indicated by the byte written to ADR1. Upon receipt of both the
primary and secondary GPIB addresses, the TLC becomes an addressed Talker or Listener. If
the TLC has received its primary GPIB Talk address, the Talker Primary Addressed State
(TPAS) bit in the ADSR is set. If the TLC has received its primary GPIB Talk address
immediately followed by its secondary GPIB Talk address, the TA bit in the ADSR is set, the
ADSC bit in ISR2 is set, and the DO bit in ISR1 is set. If the TLC has received its Primary
GPIB Listen address, the LPAS bit in the ADSR is set. If the TLC has received its primary
GPIB Listen address immediately followed by its secondary GPIB Listen address, the LA bit in
the ADSR is set, the ADSC bit in ISR2 is set, and the DI bit in ISR1 is set when the first GPIB
data byte is received. The MJMN bit in the ADSR indicates whether the address status refers to
the major or minor address.
Address Mode 3
Address Mode 3, like Address Mode 2, is used to implement Extended GPIB Talk and Listen
address recognition. However, unlike Address Mode 2, Address Mode 3 provides for both major
and minor primary addresses, and your program must identify the secondary address by reading
the CPTR. Proper operation using Address Mode 3 is listed as follows:
1. During initialization of the TLC, enable Address Mode 3 (and optionally set the APT IE bit
in IMR1 to enable an interrupt request on receipt of a secondary GPIB address). Write the
TLC major GPIB primary address to ADR0 and the TLC minor GPIB primary address to
ADR1.
2. Receipt of the TLC major or minor primary GPIB Talk Address (MTA) or major or minor
primary GPIB Listen Address (MLA) sets TPAS or LPAS, indicating that the primary
address has been received.
3. If the next GPIB command following the primary address is a secondary address, the APT bit
is set and a DAC handshake holdoff is activated (the GPIB DAC message is held false).
4. In response to APT, the program must complete the following events:
Determine whether the command just received is a listen, talk, major, or minor address by
reading the LPAS, TPAS, and MJMN bits of the ADSR.
Read the secondary address in the CPTR and determine whether or not it is the address of
the TLC.
5. If it is not the TLC address, issue the Non-Valid auxiliary command. If it is the TLC address,
issue the Valid auxiliary command.