def __init__(self,device_file,address): try: if "/" not in device_file: # means it is not a path to /dev/xxx self.using_GPIB_to_Ethernet = True self.device = prologix_ethernet(device_file) else: self.device = open(device_file, "w+") self.using_GPIB_to_Ethernet = False except: return -1 #self.write_to_dev("++mode 1") #self.write_to_dev("++addr " + str(address)) #self.write_to_dev("++auto 1") self.what_is_measured = "" self.nplc_delay_time = 0.9 self.slot = None self.channel = None self.nplc = 1 # number of power line cycles self.channel_setup_done = False self.debug = False self.write_to_dev("++mode 1") self.write_to_dev("++addr " + str(address)) self.write_to_dev("++auto 0") self.write_to_dev("++eos 3") # Dont append anything 0=CRLF 1=CR 2=LF 3=None self.write_to_dev("++eoi 1") # Indicate End-of-data self.write_to_dev("*RST") # reset device time.sleep(1.0)
def __init__(self, device_file, address): try: if "/" not in device_file: # means it is not a path to /dev/xxx self.using_GPIB_to_Ethernet = True self.device = prologix_ethernet(device_file) else: self.device = open(device_file, "w+") self.using_GPIB_to_Ethernet = False except: return -1 self.debug = False self.write_to_dev("++mode 1") self.write_to_dev("++addr " + str(address)) self.write_to_dev("++auto 0") self.write_to_dev( "++eos 0") # Dont append anything 0=CRLF 1=CR 2=LF 3=None self.write_to_dev("++eoi 1") # Indicate End-of-data time.sleep(1)
def __init__(self,prologic_ip,address): try: self.device = prologix_ethernet(prologic_ip) except: return -1 self.compliance = 0.01 self.source_range = 0 self.cur_voltage = 0 self.source_mode = "DV1" self.measure_mode = "TI" self.debug = False self.read_wait_time = 0.1 self.path2dir_temp_4200 = os.path.abspath("/home/electrochem/umdata/temp_4200/") self.device.settimeout( 10 ) self.write_to_dev("++mode 1") self.write_to_dev("++addr " + str(address)) self.write_to_dev("++auto 1") # nicht automatisch auf Antwort warten self.write_to_dev("++eos 0") # Dont append anything 0=CRLF 1=CR 2=LF 3=None self.write_to_dev("++eoi 1") # Indicate End-of-data time.sleep(0.1)
def __init__(self, device_file, address): try: if "/" not in device_file: # means it is not a path to /dev/xxx self.using_GPIB_to_Ethernet = True self.device = prologix_ethernet(device_file) else: self.device = open(device_file, "w+") self.using_GPIB_to_Ethernet = False except: return -1 self.debug = True self.write_to_dev("++mode 1") self.write_to_dev("++addr " + str(address)) self.write_to_dev("++auto 0") self.write_to_dev( "++eos 3") # Dont append anything 0=CRLF 1=CR 2=LF 3=None self.write_to_dev("++eoi 1") # Indicate End-of-data #self.write_to_dev("CAL:UNPR:ACAL:INIT") # prepare for calibration #time.sleep(2.0) #self.write_to_dev("CAL:UNPR:ACAL:STEP2") # prepare for 10mV range calibration #time.sleep(5.0) #self.write_to_dev("CAL:UNPR:ACAL:DONE") # prepare for 10mV range calibration self.nplc_delay_time = 0.1 time.sleep(1.0)
def __init__(self, device_file="electrochem-m31", mode="Potentiostat"): try: if "/" not in device_file: # means it is not a path to /dev/xxx self.using_GPIB_to_Ethernet = True self.device = prologix_ethernet(device_file) else: self.device = open(device_file, "w+") self.using_GPIB_to_Ethernet = False except: return -1 self.solartron_1287_address = 6 # address +1 is the minor address to get binary data. *Potentiostat/Galvanostat* self.solartron_1260_address = 4 # address +1 is the minor address to get binary data. *Analyzer* self.sleep_time = 0.3 # time between asking and getting the answer self.current_address = self.solartron_1260_address #self.sleep_time = 2 # time between asking and getting the answer self.sleep_time_specific_measurement = 0 self.bias = 0 self.ready = False self.mode = mode self.debug = True self.write_to_dev("++mode 1") self.talk_to_analyzer() # 1260 self.write_to_dev("++auto 0") self.write_to_dev( "++eos 3") # Dont append anything 0=CRLF 1=CR 2=LF 3=None self.write_to_dev("++eoi 1") # Indicate End-of-data #self.write_to_dev("TT1"self.solartron_1260_address) # initialize device #time.sleep(5.0) self.write_to_dev("TT2", self.solartron_1260_address) # reset device poland time.sleep(5.0) ##self.write_to_dev("TT3"self.solartron_1260_address) # reset device ##time.sleep(5.0) # Poland #self.write_to_dev("OP1,0") # no RS232 output #self.write_to_dev("OP2,1") # GPIB output #self.write_to_dev("OP3,0") # no file output #self.write_to_dev("RH0") # data output heading, poland #self.write_to_dev("BP1") # ? #self.write_to_dev("SW0") # sweep? #self.write_to_dev("VI0") # ? #self.write_to_dev("UW0") # ? #self.write_to_dev("CV1") # ? #self.write_to_dev("RR0") # ? #self.write_to_dev("AU0") # ? #self.write_to_dev("SO2,1") # ? #self.write_to_dev("FC") # file clear # Solartron self self.write_to_dev("OP2,1", self.solartron_1260_address) # GPIB output all self.talk_to_generator() # 1287 self.write_to_dev( "IL6", self.solartron_1287_address) # current limit range 2A self.write_to_dev("OL2", self.solartron_1287_address) # no current off limit self.write_to_dev("PB2", self.solartron_1287_address ) # type C potentiostat mode >1MHz bandwith self.write_to_dev( "RG0", self.solartron_1287_address) # DVM Control input range auto self.write_to_dev( "DG0", self.solartron_1287_address) # DVM Control 5x9 digits self.switch_polVI_mode_on() # 1287 self.switch_cell_on( ) # measure RE1,Re2 delta-RE, delta-RE-Bi, POL, delta-POL, CE, I, I-Bi, Half-Standby (1287) self.set_filter_off() # 10Hz Filter off (1287) self.set_dc_potential_accross_RE1_and_RE2( 0.0 ) # dc potential accross RE1 and RE2 for the potentiostat 0.0V (-14.5 to 14.5) (1287) self.set_voltage_bias_rejection_voltage( 0.0) # fixed rejection voltage 0.0V (0 to 14.5V) (1287) #self.write_to_dev("OT1") # GPIB Output terminator cr lf and EOI TODO could also be for analyser self.write_to_dev("OT1", self.solartron_1260_address) # no file output TODO self.write_to_dev("OP3,0", self.solartron_1260_address) # no file output self.write_to_dev( "OP2,0", self.solartron_1260_address) # GPIB output off ??? WFT self.write_to_dev("VI0", self.solartron_1260_address) # display frequency self.write_to_dev("SW0", self.solartron_1260_address) # disable sweeping self.write_to_dev("CV0", self.solartron_1260_address) # display options self.write_to_dev("UW0", self.solartron_1260_address) # normal phase self.set_potentiostatic_mode() # 1260 self.write_to_dev( "IA0", self.solartron_1260_address ) # generator I amplitude 0A (you need to tell this to the analyser, stupid but true) self.write_to_dev( "IB0", self.solartron_1260_address ) # generator I bias 0A (you need to tell this to the analyser, stupid but true) self.write_to_dev("ME0", self.solartron_1260_address) # monitor off #self.write_to_dev("RA3,5",self.solartron_1260_address) # input I range 60mA self.write_to_dev( "RA3,0", self.solartron_1260_address ) # input I auto-range TODO doesn't this make more sense? self.set_input_current_coupling("dc") #1260 self.write_to_dev("FV0", self.solartron_1260_address) # display options self.write_to_dev("CI0", self.solartron_1260_address) # display options self.write_to_dev("CZ0", self.solartron_1260_address) # display options self.write_to_dev("CY0", self.solartron_1260_address) # display options self.write_to_dev( "VA0", self.solartron_1260_address ) # generator voltage amplitude 0A (you need to tell this to the analyser, stupid but true) self.set_potential_bias( 0.0 ) # generator voltage bias 0A (you need to tell this to the analyser, stupid but true) (1260) self.write_to_dev("AU0", self.solartron_1260_address) # auto integration off self.set_integration_time(0.2) # integration time 0.2s (1260) self.set_integration_delay(0.0) # delay 0s (1260) self.write_to_dev("RA1,0", self.solartron_1260_address) # input V1 autorange self.write_to_dev("RA2,0", self.solartron_1260_address) # input V2 autorange self.set_input_voltage_coupling(1, "dc") # 1260 self.set_input_voltage_coupling(2, "dc") # 1260 self.set_input_mode(1, "single") # 1260 self.set_input_mode(2, "single") # 1260 self.set_outer_bnc(1, "floating") # 1260 self.set_outer_bnc(2, "floating") # 1260 self.set_outer_bnc(1, "floating") # Why do I need to repeat? (1260) self.write_to_dev( "SO1,2", self.solartron_1260_address) # source V1 / V2 could be 2,1 #self.write_to_dev("SO2,0",self.solartron_1260_address) # current on V2 TODO #self.write_to_dev("SO0,2",self.solartron_1260_address) # current on V2 TODO #self.write_to_dev("SO3,0",self.solartron_1260_address) # current on V2 TODO #self.write_to_dev("SO3,2",self.solartron_1260_address) # current on V2 TODO #self.write_to_dev("SO2,3",self.solartron_1260_address) # current on V2 TODO self.write_to_dev("BP0", self.solartron_1260_address) # error beep off self.write_to_dev( "CE", self.solartron_1260_address) # clear errors TODO 1287 self.write_to_dev("OP2,1", self.solartron_1260_address) # GPIB output all self.write_to_dev( "VA0", self.solartron_1260_address ) # generator voltage amplitude 0A (you need to tell this to the analyser, stupid but true) self.set_potential_bias( 0.0 ) # generator voltage bias 0A (you need to tell this to the analyser, stupid but true) self.write_to_dev( "PI1", self.solartron_1287_address ) # Add external signal to the polarization (from PVF pr PC F at gain of x0.01 self.switch_polarization_on() # 1287 self.write_to_dev( "TR1", self.solartron_1287_address ) # measurement trigger set to continuous measurements self.write_to_dev("RU1", self.solartron_1287_address) # digital voltmeter RUN self.write_to_dev("BR1", self.solartron_1287_address) # bias reject ON self.write_to_dev("VX1", self.solartron_1287_address ) # 10x voltage amplification to rear output self.write_to_dev("IX1", self.solartron_1287_address ) # 10x current amplification to rear output