Distortion and RMS volts sweep example
This is an example of the bus commands which should be sent to the 2016 to configure1 start,
and receive the data for a 10-point sweep. This also includes the use of the high and low cutoff
filters.
*RST ;Resets the 2016 to default conditions
*CLS ;Clears the status registers
:STAT:OPER:ENAB 8 ;This will cause the Operation Summary Bit to set
when the sweep has been completed, so that the
sweep end can be detected
*SRE 128 ;Enables the Operation Summary Bit mask to cause
the SRQ line to be asserted when the sweep is
completed
:SENS:FUNC 'DIST' ;Selects Distortion mode
:SENS:DIST:RANG:AUTO OFF ;Disables auto range
:SENS:DIST:FREQ:AUTO OFF ;Turns off the AUTO frequency mode
:SENS:DIST:TYPE THDN ;Selects THD+noise mode
:SENS:DIST:LCO 500 ;Configures the low cutoff to filter out noise below
500 Hz
:SENS:DIST:LCO:STAT ON ;Turns on the low cutoff filter
:SENS:DIST:HCO 10000 ;Configures the high cutoff to filter out noise above
10kHz
:SENS:DIST:HCO: STAT ON ;Tums on the high cutoff filter
:OUTP:LIST 1,1000,1,1100,1,1200,1,1300,1,1400,1,1500,1,1600,1,1700,1,1800,1,1900
;This will set 10 sweep points, from 1000 Hz to 1900
Hz in 100Hz steps, all at one volt amplitude
:OUTP:MODE LIST ;Selects sweep mode
:OUTP:LIST:DEL .1 ;Sets a source delay of 0.1 seconds
:OUTP:LIST:ELEM DIST,AMPL ;Selects distortion and amplitude as the data
elements to be returned
:TRIG:COUN 10 ;The 2016 will take 10 triggered measurements
OUTP ON ;Tums the output on
:INIT ;Begins the sweep (Wait for SRQ to be asserted)*
:OUTP:LIST:DATA? ;Queries the sweep data (Read data from the 2016)*
The actual syntax for these steps depends on the type of GPIB interface and control software
used. For example, the WaitSRQ function can be used with a National Instruments interface to
wait for the SRQ, and the IBRD function can be used to read the data.
Running this same sweep again only requires sending *cls and init over the bus. Sending the
*cls again is necessary to reset the sweep done bit.
2-46 Basic Measurements