Exemplo n.º 1
0
    def test_linear_sweep(self):
        chan_command = "DE CH1, '{voltage_name}','{current_name}',1,1"
        func_command = "VR1,1,5,1,0.01"
        voltage_name = random_id(CurrentVoltage.VOLTAGE) 
        current_name = random_id(CurrentVoltage.CURRENT)
        chan_command = chan_command.format(voltage_name = voltage_name, 
                current_name = current_name)
        sweep_smu = SMUSweep(1, SourceMode.VOLTAGE, SourceType.VOLTAGE, 1, 5, 1, 0.01, SweepType.LINEAR, voltage_name,
                             current_name)

        self.assertEqual(chan_command, sweep_smu._get_chan_cmd())
        self.assertEqual(func_command, sweep_smu._get_var1_cmd())
Exemplo n.º 2
0
def do_measure(ip, port):
    chan = 1
    start = 10
    stop = 100
    step = 1
    compliance = 0.005
    print ("Channel: %s" % chan)
    print "Start: %s" % start
    print "Stop: %s" % stop
    print "Step: %s" % step
    print "Compliance: %s" % compliance

    smu_sweep = SMUSweep(chan, SourceMode.VOLTAGE, SourceType.VOLTAGE, start, stop, step, compliance, SweepType.LINEAR)
    print "Commands to execute: "
    for command in smu_sweep.get_commands():
        print command
    print ip
    print port
    try:
        executor = VisaExecutor(ip, int(port))
        for command in smu_sweep.get_commands():
            executor.execute_command(command)
    except VisaIOError:
        print "Failed to connect"