예제 #1
0
    def __init__(self):
        #Initialization
        #laser I/V fitting coefficient
        self.laser_fit_coeff = [15.51e-6, 4, 0.0599]

        enhtx_gen = lrf_tx.create_enh_tx(lrf_tx.GenericLRFTx())
        self.tx_dut = lrf_tx.create_custom_tx(enhtx_gen)

        scope_address = '192.168.1.10'
        scope_lan_port = 1861
        scope_protocol = 'TCPIP'
        scope_port = generic_port.ActiveXLeCroyPort(scope_protocol,
                                                    scope_address, None)

        self.tx_adc_cfg = {
            'inductor_current': 1,
            'capacitor_voltage': 2,
            'pin_voltage': 3,
            'laser_current': 4,
        }

        self.tx_adc = osc.LeCroyWaveRunner610Zi(scope_port)
        self.tx_adc.connect()
        print "  --> tx_adc id: `%s'" % self.tx_adc.identify()
        #self.tx_adc.recall_setup_from_file('D:\GaNTxPWM112us')

        gen_address = 4
        gen_port = None
        gen_protocol = 'GPIB'
        gen_port = generic_port.PyVisaPort(gen_protocol, gen_address, gen_port)

        self.tx_drv = fxgen.AFG3102(gen_port)
        self.tx_drv.connect()
        #gen.reset()
        print "  --> self.tx_drv id: `%s'" % self.tx_drv.identify()

        self.tx_drv_cfg = {
            'pwm': 1,
            'trg': 2,
        }
        self.init_tx_drv()
        self.pwm_burst_cycles = self.tx_dut.pwm_cycles_max

        self.meas_list = []
        self.probe_dBatt = 30

        self.log_directory = None
        self.meas_filename = None
        self.log_filename = None
        self.meas_file = None
        self.log_file = None
        self.prtsc_filename = None
    meas_filename = time_filename + 'MODULE2_TPS63031PS0_T25.txt'
    print_screen_filename = time_filename + 'MODULE2_TPS63031PS0'
    print "  --> log_file: `%s'" % log_filename
    log_file = open(log_filename, 'a')
    meas_file = open(meas_filename, 'a')
    log_header = 'Log starts @:' + str(datetime.datetime.now())
    print log_header
    meas_file.write(log_header)
    meas_file.write('\nVin_set, Io_set, Vin, Iin, Vout, Iout, ' \
                     'Pin, Po, Eff, Po_Iset, Eff_Iset\n' )
    meas_file.close()

    load_board = 0
    load_address = 4
    load_protocol = 'GPIB'
    load_port = generic_port.PyVisaPort(load_protocol, load_address,
                                        load_board)
    load = load.KikusuiPLZ164W(load_port)
    load.connect()
    print "  --> scope id: `%s'" % load.identify()
    time.sleep(1)

    pwrgen_board = 0
    pwrgen_address = 2
    pwrgen_protocol = 'GPIB'
    pwrgen_port = generic_port.PyVisaPort(pwrgen_protocol, pwrgen_address,
                                          pwrgen_board)
    pwrgen = pwrgen.E3631A(pwrgen_port)
    pwrgen.connect()
    print "  --> gen id: `%s'" % pwrgen.identify()
    pwrgen.reset()
    time.sleep(1)
예제 #3
0
        self.port.set_timeout(1)

        return filename


######################################################################
## Main entry point.
######################################################################

if __name__ == "__main__":

    scope_protocol = 'GPIB'
    scope_board = 0
    scope_address = 1

    scope_port = generic_port.PyVisaPort(scope_protocol, scope_address,
                                         scope_board, DEFAULT_TIMEOUT)
    scope = TektronikTDS420A(scope_port, DEFAULT_TIMEOUT)
    scope.connect()
    print "  --> scope id: `%s'" % scope.identify()

    time.sleep(1)

    scope.get_screen_bmp('test.bmp')
    #    DSO.WriteString('f1:PAVA? top', 1)
    #    print DSO.ReadString(1000)
    #    DSO.WriteString('f1:PAVA? width', 1)
    #    print DSO.ReadString(1000)
    #    DSO.WriteString('f1:PAVA? area', 1)
    #    print DSO.ReadString(1000)
    #    DSO.WriteString('c1:PAVA? max', 1)
    #    print DSO.ReadString(1000)
        value_str = self.port.query(cmd)
        return value_str

    def trigger(self):
        """Trigger signal to execute a command"""
        self.port.write_string("*TRG")


if __name__ == "__main__":

    psupply_board = 0
    psupply_address = 2
    psupply_protocol = 'GPIB'

    gen_port = generic_port.PyVisaPort(psupply_protocol,
                                       psupply_address,
                                       psupply_board,
                                       timeout=DEFAULT_TIMEOUT)
    psu = E3631A(gen_port, DEFAULT_TIMEOUT)
    psu.connect()
    print "  --> gen id: `%s'" % psu.identify()
    psu.reset()
    time.sleep(1)
    psu.set_P6Vchannel_voltage_current(1.1, 0.1)
    psu.set_all_output_on()
    print "  --> out voltage: `%s'" % psu.get_P6Vchannel_measure_voltage()
    print "  --> out current: `%s'" % psu.get_P6Vchannel_measure_current()
    time.sleep(3)
    psu.set_all_output_off()
    psu.disconnect()

    print "Done"
예제 #5
0
    scope_address = '192.168.1.4'
    scope_lan_port = 1861
    scope_protocol = 'TCPIP'
    scope_port = generic_port.ActiveXLeCroyPort(scope_protocol, scope_address,
                                                None)
    scope = osc.LeCroyWaveRunner610Zi(scope_port)
    scope.connect()
    print "  --> scope id: `%s'" % scope.identify()
    #scope.recall_setup_from_file('D:\GaNTxPWM112us')
    time.sleep(2)

    gen_address = 4
    gen_port = None
    gen_protocol = 'GPIB'
    gen_port = generic_port.PyVisaPort(gen_protocol, gen_address, gen_port)
    gen = fxgen.AFG3102(gen_port)
    gen.connect()
    #gen.reset()
    print "  --> gen id: `%s'" % gen.identify()

    #Initialization
    dut = lrf_tx.create_enh_tx(lrf_tx.GenericLRFTx())
    #lrf_tx.print_charge_pattern(dut)

    dut.C = 660e-9
    dut.L = 10e-6
    dut.pwm_on = 6.8e-6
    dut.pwm_off = 2.4e-6
    dut.trg_delay = 112e-6
    dut.trg_on = 500e-9
예제 #6
0
        self.port.write_string(cmd)

    def trigger(self):
        #'*RCL 2''
        cmd = 'TRIGger:SEQuence:IMMediate'
        self.port.write_string(cmd)


if __name__ == "__main__":

    gen_address = 4
    gen_port = None
    gen_protocol = 'GPIB'

    gen_port = generic_port.PyVisaPort(gen_protocol,
                                       gen_address,
                                       gen_port,
                                       timeout=DEFAULT_TIMEOUT)
    gen = AFG3102(gen_port, DEFAULT_TIMEOUT)
    gen.connect()
    print "  --> gen id: `%s'" % gen.identify()
    gen.reset()
    time.sleep(1)
    gen.recall_setup_from_memory(3)
    time.sleep(1)
    gen.set_burst_cycles(1, 1)
    gen.set_burst_cycles(2, 1)
    gen.set_burst_trigger_delay(1, 0)
    gen.set_burst_trigger_delay(2, 112e-6)
    gen.set_output_on(1)
    gen.set_output_on(2)
    gen.trigger()
예제 #7
0
        value_str = self.port.query(cmd)
        return value_str

    def trigger(self, memory_cell):
        """Trigger signal to execute a command"""
        return self.port.write_string("*TRG")


if __name__ == "__main__":

    activeload_port = 0
    activeload_address = 4
    activeload_protocol = 'GPIB'

    gen_port = generic_port.PyVisaPort(activeload_protocol,
                                       activeload_address,
                                       activeload_port,
                                       timeout=DEFAULT_TIMEOUT)
    activeload = KikusuiPLZ164W(gen_port, DEFAULT_TIMEOUT)
    activeload.connect()
    print "  --> gen id: `%s'" % activeload.identify()
    activeload.reset()
    time.sleep(1)
    activeload.set_constant_current_mode()
    activeload.set_current_range_low()
    activeload.set_current_value(.1)
    activeload.set_load_on()
    time.sleep(1)
    print "  --> out current: `%s'" % activeload.get_measure_current()
    print "  --> out voltage: `%s'" % activeload.get_measure_voltage()
    activeload.set_load_off()
    activeload.disconnect()