User`s guide

Table Of Contents
Chapter 5 85
Making a Measurement
Waiting for the End of Measurement
5. Making a Measurement
Sample Program
Example 5-2 is a sample program that demonstrates how to use an SRQ to detect the end of
measurement. You can find the source file of this program, named srq_meas.htb, on the
sample program disk.
NOTE This sample program correctly runs when the maximum number of channels/traces is set 9
channels/9 traces.
The sample program sets up the trigger system, configures the instrument to properly
generate an SRQ, and then triggers the instrument. When the instrument has generated an
SRQ that indicates the end of measurement, the program exits after printing a measurement
completion message.
The program is described in detail below:
Line 40 Assigns a GPIB address to the I/O pass.
Lines 60 to 90 These lines store the settings of continuous initiation mode for each
channel (on for channels 1 and 2; off for channels 3 through 4) into the
array variable Cont_mode$(*).
Lines 110 to 130 These lines turn on or off continuous initiation mode for each channel
depending on the value of Cont_mode$(*).
Line 140 Sets the trigger source to “Bus Trigger”.
Lines 160 to 170 These lines configure the instrument so that operation status event
register's bit 4 is set to 1 only when operation status condition
register's bit 4 is changed from 1 to 0 (negative transition).
Lines 180 to 190 These lines enable the operation status event register's bit 4 and status
byte register's bit 7.
Lines 200 to 220 These lines clear the status byte register and operation status event
register.
Lines 240 to 250 These lines set the branch target for an SRQ interrupt to enable SRQ
interrupts.
Lines 260 to 290 These lines trigger the instrument, and waits until the measurement
cycle finishes.
Line 300 Displays a measurement completion message.