""" Module providing the ability to read the scope parameters, capture waveforms and graph the data. The following modules must in the working directory or the Python path: visa.py or visa_fake.py visa_devices.py supported_instruments.py instrument_classes.py configure_instruments.py The following text files must be in the current working directory (cwd). supported_instruments.txt configure_instruments.txt """ import string as s import time try: import configure_instruments as ci except: print('\nconfigure_instruments.py not found.') exit(0) def TestWithInitialization() : # Initialize instruments to the desired operational status. com, target_instruments, error, warning = ci.ReadInitializationFile('configure_instruments_for_scope_expt.txt', 'configure_instruments.py') if error : print error if warning: print warning print #for c in com : print c print target_instruments error = ci.InitializeInstruments(target_instruments, com, print_messages=True) if error : print error else : print('\nInstruments successfully initialized.') def TestSansInitialization(): instruments = ci.ic.CreateInstrumentObjects(print_messages=True) #wg = 'AFG3021B-C031285' #wg = 'AFG3021B' wg = '' #osc = 'TDS1012B-C040717' #osc = 'TDS1012B' osc = '' scope, awg = ci.ic.SelectOneInstrumentOfEachType(instruments, osc, wg, print_messages=True) print '\nSelected scope: ', scope print 'Selected wg:', awg #--------------------------------------------------------------------------------------------------- if __name__ == '__main__' : TestWithInitialization() #TestSansInitialization()