def JoinServer(self, port, host): conn=Connection.Connect(Port=port, IP=host) if conn.is_connected: self.ChatGui() else: self.UpdateStatus(self.Lan_Status, "Failed to connect to {}:{}".format(port, IP)) self.conn=conn
def connect_shutter(self): # Checks the connection between the shutter self.connection_dict['shutter_parm'][ 'connection'] = Connection.Connect() # Fills the dictionary try: shutter_rs.shutter_cnt(self.connection_dict['rm'], self.connection_dict['shutter_parm']['COM']) return 1 except: return -1
def connect_keithley(self): # Checks the connection between the keithley self.connection_dict['keithley_parm'][ 'connection'] = Connection.Connect() try: keithley_rs.keithley_cnt( self.connection_dict['rm'], self.connection_dict['keithley_parm']['COM']) return 1 except: return -1
import visa, Connection import numpy as np rm = visa.ResourceManager() keithley_com_port = 'GPIB2::20::INSTR' shutter_com_port = 'ASRL3::INSTR' pixelswitch_com_port = 'ASRL5::INSTR' keithley_cnt = Connection.Connect() keithley_cnt.keithley_cnt(rm, keithley_com_port) shutter_cnt = Connection.Connect() shutter_cnt.shutter_cnt(rm, shutter_com_port) pixelswitch_cnt = Connection.Connect() pixelswitch_cnt.pixelswitch_cnt(rm, pixelswitch_com_port) ## Example of taking JV measurement of each pixel # setup keithley to measure current at for a given voltage cmplA = 0.002 # 2 mA, compliance current src_sec = 0.05 # 50 ms, source delay time keithley_cnt.Keithley.current_sensing( cmplA, src_sec) # setup keithley to be current sensing mode keithley_cnt.Keithley.inst_output_on() # turn on OUTPUT on keithley # define voltage range vmin = -0.1 # unit in V vmax = 1.2 # unit in V pts = 200 # number of points voltage_arr = np.linspace(vmin, vmax, pts) # voltage array