GPIB Operation 3
PROGRAMMING
SERVICE REQUESTS
data blocks to the computer memory, rather than IBRD or IBWRT
which are limited to 256 bytes by the BASIC string length. Note
that IBRDI and IBWRTI only exist for BASIC, since the function
calls IBRD and IBWRT for more modem programming languages,
such as C, are much less limited in the data block size.
IBTMO can be used to change the time-out value during program
execution. The default value of the GPIB driver is 10 seconds, e.g.
if the instrument does not respond to a IBRD call, IBRD will return
with an error after the specified time.
IBTRG executes the IEEE 488.1 standard message Group Ex-
ecute Trigger (GET), which causes the oscilloscope to arm the
trigger system.
National Instruments supply a number of additional function calls.
In particular, it is possible to use the so-called board level calls
which allow a very detailed control of the GPIB. The use of such
calls is shown in Example 3 of Appendix A.
When an oscilloscope is used in a remote application, events often
occur asynchronously, i.e. at times that are unpredictable for the
host computer. The most common case is waiting for a trigger after
the instrument has been armed. The controller must wait until the
acquisition is finished before it can read the acquired waveform.
The simplest way of checking if a certain event has occurred is by
continuously or periodically reading the status bit associated with it
until the required transition is detected. Continuous status bit poll-
ing is described in more detail in the sub-section "Instrument
Polls". For a complete explanation of the status bytes refer to Sec-
tion 7.
A potentially more efficient way of detecting events occurring in
the instrument is the use of the Service Request (SRQ). This GPIB
interrupt line can be used to interrupt program execution in the
controller. Therefore, the controller can execute other programs
while waiting for the instrument. Unfortunately, not all interface
manufacturers support the programming of interrupt service rou-
tines. In particular, National Instruments only supports the SRQ
bit within the ISTA% status word. This requires the user to contin-
uously or periodically check this word, either explicitly or with the
function call IBWAIT. In the absence of real interrupt service rou-
tines the use of SRQ may not be very advantageous.
In the default state, after power-on, the Service ReQuest is dis-
abled. The SRQ is enabled by setting the Service Request Enable
register with the command "*SRE" and specifying which event
should generate an SRQ. The oscilloscope will interrupt the con-
19