If you use python for instrument control, here is the scrappy script I am using for experiments:
import pyvisa as visa
import time,sys
#py -m pip install -U pyvisa
#py -m pip install -U pyvisa-py (for the pure python backend)
#py -m pip install -U pyserial
#https://pyvisa.readthedocs.io/en/latest/index.html
#How do I know if PyVISA-py is properly installed? Get info about PyVISA, the installed backends and their options:
# python -m visa info
#On Windows, you may have to uninstall the USBTMC specific driver installed by Windows and re-install a generic driver.
#https://pyvisa.readthedocs.io/en/latest/introduction/configuring.html
#rm = visa.ResourceManager('@py') # Use pure python backend
#rm = visa.ResourceManager('@ivi') # Use IVI-VISA backend
rm = visa.ResourceManager() # default backend
#print('Available devices: ', rm.list_resources()) # Will show async serial devices (comports) as e.g. ASRL16::INSTR for COM16
print('\nOpening device:')
inst = rm.open_resource('USB0::0x0957::0x2007::MY57007585::INSTR') #For the 34972A on USB
#inst = rm.open_resource("ASRL3::INSTR", baud_rate = 115200) #For the 34970A on RS232 (need to edit port number appropriately 'ASRL?' and check instrument baud setting)
#reading and writing values:
#https://pyvisa.readthedocs.io/en/latest/introduction/rvalues.html
#inst.write('*rst; *cls') #reset to power on state, clear status
# After *rst we now have these settings:
# 1PLC, 5½ digits resolution
# scaling is OFF and scale values are cleared
# sets the scan interval to immediate (0 seconds) and the scan count to 1 sweep.
DEFAULT_TIMEOUT = 5000 # default timeout is 5 seconds
inst.timeout = DEFAULT_TIMEOUT
#print(inst.query('*IDN?'))
#print('Slot 1 card type:')
#print(inst.query(':SYST:CTYPE? 100'))
#print('Slot 2 card type:')
#print(inst.query(':SYST:CTYPE? 200'))
#print('Slot 3 card type:')
#print(inst.query(':SYST:CTYPE? 300'))
#print('Internal relay cycle count:')
#print(inst.query('DIAG:DMM:CYCLES?'))
#print(inst.query('CAL:SEC:STAT?'))
#inst.write('CAL:SEC:STAT OFF,HP034970') #unsecure the instrument
#print(inst.query('CAL:SEC:STAT?'))
#inst.write('DIAG:REL:CYCL:CLE (@118)') #clears the relay cycle count on channel 18 in card slot 100
#inst.write('DIAG:REL:CYCL:CLE (@118)') #clears the relay cycle count on channel 18 in slot 100
#inst.write('DIAGnostic:DMM:CYCLes:CLEar 1') #clear internal DMM relay cycle count K102
#inst.write('DIAGnostic:DMM:CYCLes:CLEar 2') #clear internal DMM relay cycle count K103
#inst.write('DIAGnostic:DMM:CYCLes:CLEar 3') #clear internal DMM relay cycle count K104
#inst.write('CAL:SEC:STAT ON,HP034970') #secure the instrument
#inst.write("DISP:TEXT 'HELLO'")
#time.sleep(1)
#inst.write('DISPLAY:TEXT:CLEAR')
#time.sleep(1)
#inst.write('DISPLAY OFF') # Avoid screen burn on the VFD display by switching it off
#time.sleep(1)
####################### 20 Channel Card #####################
# Assume this card is in slot 1, channels addresses are in 0x100 range
# MEASure is equivalent to CONFigure followed by a READ?
# These are the basic commands required
# MEASure:VOLTage:DC? [{<range>|AUTO|MIN|MAX|DEF}[,{<resolution>|MIN|MAX|DEF}],] (@<scan_list>)
# MEASure:RESistance? [{<range>|AUTO|MIN|MAX|DEF}[,{<resolution>|MIN|MAX|DEF}],] (@<scan_list>)
# MEASure:FRESistance? [{<range>|AUTO|MIN|MAX|DEF}[,{<resolution>|MIN|MAX|DEF}],] (@<scan_list>)
# MEASure:FREQuency? [{<range>|AUTO|MIN|MAX|DEF}[,{<resolution>|MIN|MAX|DEF}],] (@<scan_list>)
#print('Slot1 relay cycle count:')
#print(inst.query('DIAG:RELAY:CYCLES? (@101:120)')) # The relay cycle count from the chinese clone cards is always zero!!
#print(inst.query('MEAS:VOLT:DC? 10,(@112:115)')) #10VDC range, default resolution
#print(inst.query('MEAS:FRES? (@104)')) # 4W channels are paired. Specify channel 1 to 10, which is paired with 11 to 20.
print(inst.query('MEAS:CURR:DC? 1,(@121:122)')) #1A range, default resolution
#time.sleep(1) #1sec delay
exit()
# temperature stuff
#inst.query('SENS:TEMP:TRAN:TC:TYPE K,(@101)')
#inst.query('SENS:TEMP:TRAN:TC:RJUN:TYPE FIXED,(@101)')
#print(inst.query('SENS:TEMP:RJUN? (@102)')) #read the internal ref junction temp for bank1 ch01-10 (from DS75 U152)
#print(inst.query('SENS:TEMP:RJUN? (@118)')) #read the internal ref junction temp for bank1 ch11-20 (from DS75 U151)
print(inst.query('MEAS:CURR:DC? 1,MAX,(@121)')) #1A DC range, 6½ digits of resolution
print('\n---Measuring Examples---')
print('Measure one channel:')
print(inst.query('MEAS:VOLT:DC? 100,MAX,(@101)')) #100VDC range, 6½ digits of resolution
print('Measure one channel:')
print(inst.query('MEAS:VOLT:DC? 10,(@112)')) #10VDC range, default resolution
exit()
print('Measure several sequential channels:')
voltages = inst.query('MEAS:VOLT:DC? (@101:104)') #Auto ranging, default resolution
print(voltages)
print('Measure random channels:')
inst.timeout = 20000 # 15 sec timeout for this longer operation
print(inst.query('MEAS:VOLT:DC? (@101:110,115,120)'))
inst.timeout = DEFAULT_TIMEOUT
print('Measure 2W resistance:')
print(inst.query('MEAS:RES? (@118)'))
print(inst.query('MEAS:RES? (@101)'))
print(inst.query('MEAS:RES? (@102)'))
print('Measure 4W resistance:')
print(inst.query('MEAS:FRES? (@109)')) # 4W channels are paired. Specify channel 1 to 10, which is paired with 11 to 20.