Ejemplo n.º 1
0
def re_measure(cycle=1):
    Temp = Ud = Ud_m = Id = 0.

    if ag.temperature() >= 50.0:
        print "Hi, temperature! Cool!"
        ag.stop_output("all")
        ag.state_output()
        while ag.temperature() >= 40.0:
            print "Current Temperature: %.2f, Delay: %d sec" % ( ag.temperature(),60 * MEASURE_DELAY )
            print "Delay"
            for sec in xrange( 12 * MEASURE_DELAY ):
                print "%d, " % (sec*5),
                time.sleep(5)

        ag.start_output("all")
        

    for i in xrange(cycle):
        time.sleep( MEASURE_DELAY )
        
        Temp    += ag.temperature()
        Ud      += ag.source_value(1,"volt")
        Ud_m    += ag.measure(1,"volt")
        Id      += ag.measure(1,"cur")


        

    cycle = float(cycle)
    Measurements["Temp"] = Temp / cycle
    Measurements["Ud"]   = Ud   / cycle
    Measurements["Ud_m"] = Ud_m / cycle
    Measurements["Id"]   = Id   / cycle
Ejemplo n.º 2
0
def re_measure(cycle=1):
    Temp = Uc = Uc_m = Ic = Ue = Ue_m = Ib = 0.0

    if ag.temperature() >= 50.0:
        print "High temperature! Cooler!!!!"
        ag.stop_output("all")
        ag.state_output()
        while ag.temperature() >= 40.0:
            print "Current Temperature: %.2f, Delay: %d sec" % (ag.temperature(), 60 * DELAY_MEASURE)
            print "Delay"
            for sec in xrange(12 * DELAY_MEASURE):
                print "%d, " % (sec * 5),
                time.sleep(5)

        ag.start_output("all")

    for i in xrange(cycle):
        time.sleep(DELAY_MEASURE)

        Temp += ag.temperature()
        Uc += ag.source_value(2, "volt")
        Uc_m += ag.measure(2, "volt")
        Ic += ag.measure(2, "cur")
        Ue += ag.source_value(1, "volt")
        Ue_m += ag.measure(1, "volt")
        Ib += ag.measure(1, "cur")

    cycle = float(cycle)
    Measurements["Temp"] = Temp / cycle
    Measurements["Uc"] = Uc / cycle
    Measurements["Uc_m"] = Uc_m / cycle
    Measurements["Ic"] = Ic / cycle
    Measurements["Ue"] = Ue / cycle
    Measurements["Ue_m"] = Ue_m / cycle
    Measurements["Ib"] = Ib / cycle
Ejemplo n.º 3
0
def re_measure(cycle=1):
    global Measurements

    if ag.temperature() >= 50.0:
        print "High temperature! Cooler!!!!"
        ag.stop_output("all")
        ag.state_output()
        while ag.temperature() >= 40.0:
            print "Current Temperature: %.2f, Delay: %d sec" % ( ag.temperature(),60 * MEASURE_DELAY )
            print "Delay"
            for sec in xrange( 12 * MEASURE_DELAY ):
                print "%d, " % (sec*5),
                time.sleep(5)

        ag.start_output("all")
    

    Ids = Uds = Uds_m = Ugs = Ugs_m = Ubs = Ubs_m = Temp = 0.0


    for i in xrange(cycle):
        # Impulse measure
        time.sleep( MEASURE_DELAY )
        _measures = deepcopy(ag.measure_all())

        Ids   += _measures['ch1']['curr']['meas'] 
        Uds   += _measures['ch1']['volt']['sour']
        Uds_m += _measures['ch1']['volt']['meas']
        Ugs   += _measures['ch2']['volt']['sour']
        Ugs_m += _measures['ch2']['volt']['meas']
        Ubs   += _measures['ch3']['volt']['sour']
        Ubs_m += _measures['ch3']['volt']['meas']

        Temp  += _measures['temp']

        

    Measurements['Ids']   = Ids   / float(cycle)
    Measurements['Uds']   = Uds   / float(cycle)
    Measurements['Uds_m'] = Uds_m / float(cycle)
    Measurements['Ugs']   = Ugs   / float(cycle)
    Measurements['Ugs_m'] = Ugs_m / float(cycle)
    Measurements['Ubs']   = Ubs   / float(cycle)
    Measurements['Ubs_m'] = Ubs_m / float(cycle)
    Measurements['Temp']  = Temp  / float(cycle)
Ejemplo n.º 4
0
def execute():

    global IV_I,IV_V,Measurements,stop_measure,error_sat,GRAPH_2_X,GRAPH_2_Y

    # Задержка между измерениями  
    # time.sleep( DELAY_MEASURE )

    if error_sat >= 1:
        return False

    re_measure()
    
    no_inc = False

    try:
        good_rng = ag.get_good_range("v",Measurements["Ue_m"])
        if ag.get_range(1,"v") != good_rng:
            ag.set_range( 1,"v",good_rng)
            print "@CH1 New range: %s , Ue = %.2f" % (good_rng, Measurements["Ue_m"] ) 

        #Ue_check = round(Measurements["Ue_m"],2)
        # Выставляем оптимальный диапазон
        #print "@CH1 Good range: %s" % ( ag.get_good_range( "c", Measurements["Ib"] ) )
        #if not(abs(Ue_check) < 0.02+abs(Measurements["Ue"]) and abs(Ue_check) > abs(Measurements["Ue"])-0.02):
        #    next_range = ag.next_range(ag.get_range(1,"c"),"c")
        #    ag.set_range( 1,"c",next_range)
        #    time.sleep(DELAY_MEASURE*2)
        #    re_measure()
        #    
        #    Ue_check = round(Measurements["Ue_m"],2)  
        #    if not(abs(Ue_check) < 0.02+abs(Measurements["Ue"]) and abs(Ue_check) > abs(Measurements["Ue"])-0.02):
        #      print "F**K"
        #      #print Ue_check
        #      return True
        #      #  

        Uc_check = round(Measurements["Uc_m"],2)
        # Выставляем оптимальный диапазон
        #print "@CH1 Good range: %s" % ( ag.get_good_range( "c", Measurements["Ib"] ) )
        if not(abs(Uc_check) < 0.03+abs(Measurements["Uc"]) and abs(Uc_check) > abs(Measurements["Uc"])-0.03):
            next_range = ag.next_range(ag.get_range(2,"c"),"c")
            ag.set_range( 2,"c",next_range)
            time.sleep(MEASURE_DELAY*2)
            re_measure()
            
            #Uc_check = round(Measurements["Uc_m"],2)  
            #if not(abs(Uc_check) < 0.03+abs(Measurements["Uc"]) and abs(Uc_check) > abs(Measurements["Uc"])-0.03):
            #    no_inc = True
            #  print "F**K"
              #print Uc_check
                #return True
              #print "F**K"        


        #prev_range = ""
        #while ag.get_good_range( "c", Measurements["Ib"] ) != ag.get_range(1,"c"):
        #    if prev_range == "":
        #        ag.set_range( 1,"c",ag.get_good_range( "c",Measurements["Ib"] ) )
        #        prev_range = ag.get_good_range( "c",Measurements["Ib"] )
        #    else:
        #        rng_good = ag.get_good_range( "c",Measurements["Ib"] )
        #        if ag.get_range_num(rng_good,"c") < ag.get_range_num(prev_range,"c"):
        #            break
        #        else:
        #            ag.set_range( 1,"c",rng_good )
        #            prev_range = rng_good
        #    print "@CH1 New range: %s , Ib = %.2e" % (ag.get_good_range( "c", Measurements["Ib"] ), Measurements["Ib"] )
        #    re_measure()

        prev_range = ""
        while ag.get_good_range( "c", Measurements["Ic"] ) != ag.get_range(2,"c"):
            if prev_range == "":
                ag.set_range( 2,"c",ag.get_good_range( "c",Measurements["Ic"] ) )
                prev_range = ag.get_good_range( "c",Measurements["Ic"] )
            else:
                rng_good = ag.get_good_range( "c",Measurements["Ic"] )
                if ag.get_range_num(rng_good,"c") < ag.get_range_num(prev_range,"c"):
                    break
                else:
                    ag.set_range( 2,"c",rng_good )
                    prev_range = rng_good
            print "@CH2 New range: %s , Ib = %.2e" % (ag.get_good_range( "c", Measurements["Ib"] ), Measurements["Ib"] )
            re_measure()

        #while ag.get_good_range( "c", Measurements["Ib"] ) != ag.get_range(1,"c"):
        #    ag.set_range( 1,"c",ag.get_good_range( "c",Measurements["Ib"] ) )
        #    print "@CH1 New range: %s , Ib = %.2e" % (ag.get_good_range( "c", Measurements["Ib"] ), Measurements["Ib"] )
        #    re_measure()
        
        #print "@CH2 Good range: %s" % ( ag.get_good_range( "c", Measurements["Ic"] ) )
        
        #while ag.get_good_range( "c", Measurements["Ic"] ) != ag.get_range(2,"c"):
        #    ag.set_range( 2,"c",ag.get_good_range( "c",Measurements["Ic"] ) )
            #print "@CH2 New range: %s , Ib = %.2e" % (ag.get_good_range( "c", Measurements["Ic"] ), Measurements["Ic"] )
        #    re_measure()
        
        #if not(abs(Uc_check) < 0.02+abs(Measurements["Uc"]) and abs(Uc_check) > abs(Measurements["Uc"])-0.02):
        #    next_range = ag.next_range(ag.get_range(2,"c"),"c")
        #    ag.set_range( 2,"c",next_range)
        #    re_measure()    

        #Uc_check = round(Measurements["Uc_m"],2)
        #assert(abs(Uc_check) < 0.02+abs(Measurements["Uc"]) and abs(Uc_check) > abs(Measurements["Uc"])-0.02)
        
        
        if round(Measurements["Ic"],3) == 0.120:
            if error_sat >= 1:
                return False
            else:
                error_sat += 1
            
        # Проводим измерения
        re_measure(MEASURE_COUNT)
            
            
        #if Measurements["Ib"] < 0.00:
        #    raise ValueError
        
        
        #if Measurements["Ib"] < LastMeasurements["Ib"]:
        #    raise ValueError 

        

        
        Ue       = Measurements["Ue_m"]
        Ue_meas  = Measurements["Ue_m"]
        Ib       = Measurements["Ib"]
        Ib_meas  = Measurements["Ib_m"]
        Uc       = Measurements["Uc"]
        Uc_meas  = Measurements["Uc_m"]
        Ic       = Measurements["Ic"]
        Temp     = Measurements["Temp"]
        
        #Uc_check = round(Uc_meas,2)
        #if not(abs(Uc_check) < 0.03+abs(Uc) and abs(Uc_check) > abs(Uc)-0.03):
        #    no_inc = True  

        #Ue_check = round(Ue_meas,2)
        #if not(abs(Ue_check) < 0.03+abs(Ue) and abs(Ue_check) > abs(Ue)-0.03):
        #    no_inc = True


        if Ib != 0.0:
            # B = Ic / Ib_meas
            B = Ic / Ib
        else:
            B = float("-inf")
        
        write2file(fdbg,"%.2f\t%.2e\t%.2e\t%.2f\t%.2f\t%.2e\t%.2f\t%.2f" % (Ue,Ib,Ib_meas,Uc,Uc_meas,Ic,B,Temp),True)
        write2file(fmeasure,"%.2f\t%.2e\t%.2f\t%.2e" % (Ue,Ib,Uc,Ic))     



        
        
    except AssertionError:
        pass
        #stop_measure = True
        #print "Stop measure"
        #print "Uc:%.2f" % ( round(Measurements["Uc_m"],2) )
        #print "Current range CH2: %s" % ( ag.get_range(2,"c") )
        #return False
    except ValueError:
        ag.stop_output(1)
        time.sleep( MEASURE_DELAY )
        ag.start_output(1)
        print "Value Error"
        return False
    else:
        if Ib != 0.0:
            B = Ic/Ib
        else:
            B = float("-inf")

        if B >= 1.0 and no_inc == False:
            GRAPH_2_X += [Ib]
            GRAPH_2_Y += [B]

        # LastMeasurements = Measurements
        
        return True
    
    finally:
        pass
        #ag.debug()

    return True
Ejemplo n.º 5
0
    
    ag.initialize(1,"v","R20V",Uc)       
    ag.initialize(2,"c","R1uA")
    
    # Задаём источник постоянного напряжения
    ag.source(2,"v",Uc)  
    
    
      
    
    write2file(fdbg,"@Uc=%.2f" % (Uc),True)
    write2file(fdbg,"Forward I-V",True)
    write2file(fdbg,"Ue\tIb\t\tIb_m\t\tUc\tUc_meas\tIc\t\tBetta\tTemp",True)
    
    
    ag.start_output(2)
    
    for Ib in Ib_RANGES:
        stop_measure = False

        good_rng = ag.get_good_range("c",Ib)
        ag.initialize(1,"c",good_rng)
        ag.source(1,"c",Ib)
        ag.start_output(1)  
        failed = 0
        if not execute():
            #print "Stop_measure: "+str(stop_measure)
            if stop_measure:
                break;
        #while not execute() and failed < MAX_FAILED:
        #    failed+=1                    #Функция измерения
Ejemplo n.º 6
0
    print "%s\t%.2f\t%.2f\t%.2f\t%.2f\t%.2f\t%.2f\t%.2e\t%.2f" % (_smile, 
        meas('Uds'),meas('Uds_m'),meas('Ugs'),meas('Ugs_m'), \
        meas('Ubs'),meas('Ubs_m'),meas('Ids'),meas('Temp') )

    return True

if INCLUDE_GRAPHICS:
    plt.figure(1,figsize=(18, 9), dpi=80, facecolor='w', edgecolor='k')

style = 0

# 


ag.start_output('all')
for Ubs in Ubs_RANGES:
    ag.source(CHANNEL_UBS,'v',Ubs)
    for Ugs in Ugs_RANGES:
        ag.source(CHANNEL_UGS,'v',Ugs)
        GRAPH_Y = []
        GRAPH_X = []
        style += 1

        title = "Ugs=%.2f, Ubs=%.2f" % (Ugs,Ubs)
        print title
        print "  \tUds\tUds_m\tUgs\tUgs_m\tUbs\tUbs_m\tIds\t        Temp"

        for Uds in Uds_RANGES:
            ag.source(CHANNEL_UDS,'v',Uds)
Ejemplo n.º 7
0
def execute():

    global IV_I,IV_V,Measurements,stop_measure

    # Задержка между измерениями  
    # time.sleep( MEASURE_DELAY )

    re_measure()
    

    try:
        Uc_check = round(Measurements["Uc_m"],2)
        # Выставляем оптимальный диапазон
        #print "@CH1 Good range: %s" % ( ag.get_good_range( "c", Measurements["Ib"] ) )
        
        if not(abs(Uc_check) < 0.02+abs(Measurements["Uc"]) and abs(Uc_check) > abs(Measurements["Uc"])-0.02):
            next_range = ag.next_range(ag.get_range(2,"c"),"c")
            ag.set_range( 2,"c",next_range)
            re_measure()
        
        #while ag.get_good_range( "c", Measurements["Ib"] ) != ag.get_range(1,"c"):
        #    ag.set_range( 1,"c",ag.get_good_range( "c",Measurements["Ib"] ) )
            #print "@CH1 New range: %s , Ib = %.2e" % (ag.get_good_range( "c", Measurements["Ib"] ), Measurements["Ib"] )
        #    re_measure()
        
        #print "@CH2 Good range: %s" % ( ag.get_good_range( "c", Measurements["Ic"] ) )
        prev_range = ""
        while ag.get_good_range( "c", Measurements["Ic"] ) != ag.get_range(2,"c"):
            if prev_range == "":
                ag.set_range( 2,"c",ag.get_good_range( "c",Measurements["Ic"] ) )
                prev_range = ag.get_good_range( "c",Measurements["Ic"] )
            else:
                rng_good = ag.get_good_range( "c",Measurements["Ic"] )
                if ag.get_range_num(rng_good,"c") < ag.get_range_num(prev_range,"c"):
                    break;
                else:
                    ag.set_range( 2,"c",rng_good )
                    prev_range = rng_good
            print "@CH2 New range: %s , Ic = %.2e" % (ag.get_good_range( "c", Measurements["Ic"] ), Measurements["Ic"] )
            re_measure()
            
        Uc_check = round(Measurements["Uc_m"],2)
        assert(abs(Uc_check) < 0.02+abs(Measurements["Uc"]) and abs(Uc_check) > abs(Measurements["Uc"])-0.02)

        
            
        # Проводим измерения
        re_measure(MEASURE_COUNT)
            
            
        #if Measurements["Ib"] < 0.00:
        #    raise ValueError
        
        
        #if Measurements["Ib"] < LastMeasurements["Ib"]:
        #    raise ValueError 

        

        
        Ue       = Measurements["Ue"]
        Ib_meas  = Measurements["Ib_m"]
        Ib         = Measurements["Ib"]
        Uc         = Measurements["Uc"]
        Uc_meas     = Measurements["Uc_m"]
        Ic         = Measurements["Ic"]
        Temp     = Measurements["Temp"]
        
            
        write2file(fdbg,"%.2f\t%.2e\t%.2e\t%.2f\t%.2f\t%.2e\t%.2f" % (Ue,Ib,Ib_meas,Uc,Uc_meas,Ic,Temp),True)
        write2file(fmeasure,"%.2f\t%.2e\t%.2f\t%.2e" % (Ue,Ib,Uc,Ic))     

        
        
    except AssertionError:
        stop_measure = True
        print "Stop measure"
        print "Uc:%.2f" % ( round(Measurements["Uc_m"],2) )
        return False
    except ValueError:
        ag.stop_output(1)
        time.sleep( MEASURE_DELAY )
        ag.start_output(1)
        print "Value Error"
        return False
    else:
        IV_I += [Ic]
        IV_V += [Uc]
        #LastMeasurements = Measurements
        
        return True
    
    finally:
        pass
        #ag.debug()

    return True
Ejemplo n.º 8
0
  ag.initialize(2,"c","R1uA")
 
  
  
  # Задаём источник постоянного тока
  ag.source(1,"c",Ib)  
  
  
    
  
  write2file(fdbg,"@Ib=%.2e" % (Ib),True)
  write2file(fdbg,"Forward I-V",True)
  write2file(fdbg,"Ue\tIb\t\tIb_m\t\tUc\tUc_meas\tIc\t\tTemp",True)
  
  
  ag.start_output(1) # Запускаем источник
  
  for Uc in Uc_RANGES:
      stop_measure = False
      ag.source(2,"volt",Uc)
      ag.start_output(2)  
      failed = 0
      if not execute():
          #print "Stop_measure: "+str(stop_measure)
          if stop_measure:
              break
      #while not execute() and failed < MAX_FAILED:
      #    failed+=1                    #Функция измерения
      ag.stop_output(2)
      time.sleep( 1 )
          
Ejemplo n.º 9
0
def execute():

    global IV_I,IV_V,Measurements,stop_measure,error_sat,GRAPH_2_X,GRAPH_2_Y,PrevMeasurements

    # Задержка между измерениями  
    # time.sleep( DELAY_MEASURE )

    if error_sat >= 1:
        return False

    re_measure()
    

    no_inc = False

    try:
        Ue_check = round(Measurements["Ue_m"],2)
        # Выставляем оптимальный диапазон
        #print "@CH1 Good range: %s" % ( ag.get_good_range( "c", Measurements["Ib"] ) )
        if not(abs(Ue_check) < 0.04+abs(Measurements["Ue"]) and abs(Ue_check) > abs(Measurements["Ue"])-0.04):
            next_range = ag.next_range(ag.get_range(1,"c"),"c")
            ag.set_range( 1,"c",next_range)
            time.sleep(MEASURE_DELAY*2)
            re_measure()
            
            #Ue_check = round(Measurements["Ue_m"],2)  
            

        Uc_check = round(Measurements["Uc_m"],2)
        # Выставляем оптимальный диапазон
        #print "@CH1 Good range: %s" % ( ag.get_good_range( "c", Measurements["Ib"] ) )
        if not(abs(Uc_check) < 0.04+abs(Measurements["Uc"]) and abs(Uc_check) > abs(Measurements["Uc"])-0.04):
            next_range = ag.next_range(ag.get_range(2,"c"),"c")
            ag.set_range( 2,"c",next_range)
            time.sleep(MEASURE_DELAY*2)
            re_measure()
            
            #Uc_check = round(Measurements["Uc_m"],2)  
                 


        prev_range = ""
        while ag.get_good_range( "c", Measurements["Ib"] ) != ag.get_range(1,"c"):
            if prev_range == "":
                ag.set_range( 1,"c",ag.get_good_range( "c",Measurements["Ib"] ) )
                prev_range = ag.get_good_range( "c",Measurements["Ib"] )
            else:
                rng_good = ag.get_good_range( "c",Measurements["Ib"] )
                if ag.get_range_num(rng_good,"c") < ag.get_range_num(prev_range,"c"):
                    break
                else:
                    ag.set_range( 1,"c",rng_good )
                    prev_range = rng_good
            print "@CH1 New range: %s , Ib = %.2e" % (ag.get_good_range( "c", Measurements["Ib"] ), Measurements["Ib"] )
            re_measure()

        prev_range = ""
        while ag.get_good_range( "c", Measurements["Ic"] ) != ag.get_range(2,"c"):
            if prev_range == "":
                ag.set_range( 2,"c",ag.get_good_range( "c",Measurements["Ic"] ) )
                prev_range = ag.get_good_range( "c",Measurements["Ic"] )
            else:
                rng_good = ag.get_good_range( "c",Measurements["Ic"] )
                if ag.get_range_num(rng_good,"c") < ag.get_range_num(prev_range,"c"):
                    break
                else:
                    ag.set_range( 2,"c",rng_good )
                    prev_range = rng_good
            print "@CH2 New range: %s , Ib = %.2e" % (ag.get_good_range( "c", Measurements["Ib"] ), Measurements["Ib"] )
            re_measure()

        #while ag.get_good_range( "c", Measurements["Ib"] ) != ag.get_range(1,"c"):
        #    ag.set_range( 1,"c",ag.get_good_range( "c",Measurements["Ib"] ) )
        #    print "@CH1 New range: %s , Ib = %.2e" % (ag.get_good_range( "c", Measurements["Ib"] ), Measurements["Ib"] )
        #    re_measure()
        
        #print "@CH2 Good range: %s" % ( ag.get_good_range( "c", Measurements["Ic"] ) )
        
        #while ag.get_good_range( "c", Measurements["Ic"] ) != ag.get_range(2,"c"):
        #    ag.set_range( 2,"c",ag.get_good_range( "c",Measurements["Ic"] ) )
            #print "@CH2 New range: %s , Ib = %.2e" % (ag.get_good_range( "c", Measurements["Ic"] ), Measurements["Ic"] )
        #    re_measure()
        
        #if not(abs(Uc_check) < 0.02+abs(Measurements["Uc"]) and abs(Uc_check) > abs(Measurements["Uc"])-0.02):
        #    next_range = ag.next_range(ag.get_range(2,"c"),"c")
        #    ag.set_range( 2,"c",next_range)
        #    re_measure()    

        #Uc_check = round(Measurements["Uc_m"],2)
        #assert(abs(Uc_check) < 0.02+abs(Measurements["Uc"]) and abs(Uc_check) > abs(Measurements["Uc"])-0.02)
        
        
        if round(Measurements["Ic"],3) == 0.120:
            if error_sat >= 1:
                return False
            else:
                error_sat += 1
        


        re_measure(MEASURE_COUNT)

        

        Ue       = Measurements["Ue"]
        Ue_meas  = Measurements["Ue_m"]
        Ib         = Measurements["Ib"]
        Uc         = Measurements["Uc"]
        Uc_meas     = Measurements["Uc_m"]
        Ic         = Measurements["Ic"]
        Temp     = Measurements["Temp"]


        

        Uc_check = round(Uc_meas,2)
        if not(abs(Uc_check) < 0.04+abs(Uc) and abs(Uc_check) > abs(Uc)-0.04):
            no_inc = True  

        Ue_check = round(Ue_meas,2)
        if not(abs(Ue_check) < 0.04+abs(Ue) and abs(Ue_check) > abs(Ue)-0.04):
            no_inc = True
        # if Ib < 0 or Ic < 0:

            
        #if Measurements["Ib"] < 0.00:
        #    raise ValueError
        
        
        #if Measurements["Ib"] < LastMeasurements["Ib"]:

        if Ib != 0.0:
            B = Ic / Ib
        else:
            B = float("-inf")
        
        #if B > 0:    

        write2file(fdbg,"%.2f\t%.2f\t%.2e\t%.2f\t%.2f\t%.2e\t%.2f\t%.2f" % (Ue,Ue_meas,Ib,Uc,Uc_meas,Ic,B,Temp),True)
        write2file(fmeasure,"%.2f\t%.2e\t%.2f\t%.2e" % (Ue,Ib,Uc,Ic))     
        
        
        
    except AssertionError:
        pass
        #stop_measure = True
        #print "Stop measure"
        #print "Uc:%.2f" % ( round(Measurements["Uc_m"],2) )
        #print "Current range CH2: %s" % ( ag.get_range(2,"c") )
        #return False
    except ValueError:
        ag.stop_output(1)
        time.sleep( MEASURE_DELAY )
        ag.start_output(1)
        print "Value Error"
        return False
    else:
        if Ib != 0.0:
            B = Ic/Ib
        else:
            B = float("-inf")

        if B >= 1.0 and no_inc == False:
            
            if PrevMeasurements["Ib"] > Ib:
                #no_inc = True
                print "FUUU upper"
            else:
                IV_I += [B]
                IV_V += [Ue]
                GRAPH_2_X += [Ic]
                GRAPH_2_Y += [B]

                PrevMeasurements = deepcopy(Measurements)

        elif no_inc == True:
            ag.stop_output("all")
            time.sleep(2)
            ag.start_output("all")

        # LastMeasurements = Measurements
        
        return True
    
    finally:
        pass
        #ag.debug()

    return True