3
GPIB Operation
|
|
Example 1
Example 2
troller as soon as the selected event(s) occur by asserting the SRQ
interface line. If several devices are connected to the GPIB, the
controller may have to identify which instrument caused the inter-
rupt by serial polling the various devices.
Note: The SRQ bit is latched until the controller reads the STatus
Byte Register (STB). The action of reading the STB with the com-
mand "*STB?" clears the register contents except the MAV bit
(bit 4) until a new event occurs. Service requesting may be dis-
abled by clearing the SRE register ("*SRE 0").
To assert SRQ in response to the events "new signal acquired"
or "return-to-local" (pressing the front-panel button LO-
CAL).
These events are tracked by the INR register which is reflected in
the SRE register as the INB summary bit in position 0. Since the bit
position 0 has the value 1, the command "*SRE 1" enables the
generation of SRQ whenever the INB summary bit is set.
In addition, the events of the INR register which may be summa-
rized in the INB bit must be specified. The event "new signal
acquired" corresponds to INE bit 0 (value 1) while the event "re-
turn-to-local" is assigned to INE bit 2 (value 4). The total sum
1+4=5. Thus the command "INE 5" is needed.
CMD$="INE 5;*SRE 1"
CALL IBWRT(SCOPE%,CMD$)
To assert SRQ when soft key 10 is pressed.
The event "soft key 10 pressed" is tracked by the URR register.
Since the URR register is not directly reflected in STB but only in
the ESR register (URR, bit position 6), the ESE enable register
must be set first with the command "*ESE 64" to allow the URQ
setting to be reported in STB. An SRQ request will now be gener-
ated provided that the ESB summary bit (bit position 5) in the SRE
enable register is set ("*SRE 32").
CMD$="*ESE 64;*SRE 32"
CALL IBWRT(SCOPE%,CMD$)
II
II
l
l
I
I
II
l
l
I!
n
II
II
II
2O
II
II