Tektronix Technical Forums are maintained by community involvement. Feel free to post questions or respond to questions by other members. Should you require a time-sensitive answer, please contact your local Tektronix support center here.

VI_ERROR_TMO (-1073807339): Timeout expired before operation completed

Models 2450, 2460, 2461, 2470
Post Reply
apw745
Posts: 6
Joined: April 5th, 2021, 7:36 am
Country: United Kingdom

VI_ERROR_TMO (-1073807339): Timeout expired before operation completed

Post by apw745 » April 15th, 2021, 9:22 am

Hi,

I wrote some py script in Jupyter notebook for using the keithley 2450 to carry out IV traces and returning the measurements. I've been using them for the past couple days but now python reports 'VI_ERROR_TMO (-1073807339): Timeout expired before operation completed' and in one instance the keithley screen showed a terminal error and asked to be restarted.

My code:

Code: Select all



def beep(freq,dur):
    
    keith.write('SYSTem:BEEPer '+ str(freq)+','+str(dur))
###

def reset():
    keith.write('*RST')
###

# switch on or off:
def keith_output(stat = None):
    stat = str(stat) or 'off'
    keith.write('OUTPut '+str(stat))

def res_trace(n = None, max_v = None, min_v = None, data_points = None, r_crit = None,
             ilim = None):
    
    beep(164,0.5)
    # check values and provide defaults
    n = n or 0
    data_points = data_points or 100
    max_v = max_v or 0.5
    min_v = min_v or -0.5
    r_crit = r_crit or 1e+7
    ilim = ilim or 'MAXimum'
    v = np.linspace( min_v, max_v, num = data_points)
    i = []
    res_run = [] 
    
    # reset keithley 
    # just so we can use them without any prior settings
    reset()

    # set up I measurement systems
    keith.write(':SENSe:FUNCtion "CURR"')
    keith.write(':SENSe:CURRent:RANGe:AUTO 1')
    keith.write(':SENSe:CURRent:UNIT AMP')
    keith.write(':SENSe:CURRent:NPLCycles DEFault')
    keith.write(':SENSe:COUNt DEFault')
    keith.write(':SENSe:CURRent:OCOM ON')
    
    # set up V source, (Hi Michale here!)
    keith.write(':SOURce:FUNCtion VOLT')
    keith.write(':SOURce:VOLTage:RANGe '+str(max_v))
    keith.write(':SOURce:VOLTage:ILIMit '+ ilim)

    # Turn keith on
    keith_output('on')

    for j in v:
    
        keith.write(':SOURce:VOLT '+str(j))
        itemp =  float(keith.query(':MEASure:CURRent?'))
        i.append(itemp)
    ###
    
    # turn them off
    keith_output('off')
    
    # plot
    plt.figure()
    plt.title('Res trace # '+str(n))
    plt.plot(v,i, c = 'm')
    plt.xlabel('V')
    plt.ylabel('I')
    plt.grid()
    plt.show()
    
    # check R value
    r_stat, intercept, r_value, p_value, std_err = linregress(i, v)
    res_run = r_stat
    
    
    # check state
    if r_stat < r_crit and r_stat > 0:
        print(int(r_stat), ' ohm, too small')
        R_status = 0
        df_data = pd.DataFrame({'Vsd_res':[v],'n':n,'Isd_res':[i],'Broken':R_status})
    ###   
    
    if r_stat > r_crit or r_stat < 0:
        print(int(r_stat),' ohm, surpased R_crit')
        R_status = 1
        df_data = pd.DataFrame({'Vsd_res':[v],'n':n,'Isd_res':[i],'Broken':R_status})
    ###
    beep(164,0.5)
    reset()
    return( R_status, df_data)
    
    # generic V pulse for BD
def Eburn(m = None, v_pred = None, data_points = None, ilim = None):
    
    beep(659, 0.5)
    # check input
    v_pred = v_pred or 0
    m = m or 0
    data_points = data_points or 100
    i = []
    ilim = ilim or 'MAXimum'
    
    v = v_pred
    
     # reset keithley 
    # just so we can use them without any prior settings
    reset()

    # set up I measurement systems
    keith.write(':SENSe:FUNCtion "CURR"')
    keith.write(':SENSe:CURRent:RANGe:AUTO 1')
    keith.write(':SENSe:CURRent:UNIT AMP')
    keith.write(':SENSe:CURRent:NPLCycles DEFault')
    keith.write(':SENSe:COUNt DEFault')
    keith.write(':SENSe:CURRent:OCOM ON')
    
    # set up V source
    keith.write(':SOURce:FUNCtion VOLT')
    keith.write(':SOURce:VOLTage:RANGe '+str(v))
    keith.write(':SOURce:VOLTage:ILIMit '+ ilim)

    # Turn keith on
    
    keith_output('on')

    for j in range(data_points):
    
        keith.write(':SOURce:VOLT '+str(v))
        itemp =  float(keith.query(':MEASure:CURRent?'))
        i.append(itemp)
    ###
    
    # turn them off
    keith_output('off')
    
    # plot
    plt.figure()
    plt.title('Eburn '+str(v)+' V #'+str(m))
    plt.plot(i, c = 'm')
    plt.ylabel('I')
    plt.ticklabel_format(useOffset=False)
    plt.grid()
    plt.show()
    
    # store data
    df_data = pd.DataFrame({'Vsd_brn':[v],'n':m,'Isd_brn':[i]})
    beep(659, 0.5)
    reset()
    return(df_data)
###
    
    
###
[code]
I also noticed another post asking something similar. I have checked it is in NI instruments, refreshing the interactive window shows the correct Id but the error still persists.

Initials I ask for an Id and beep the beeper, everything works. But when I use res_trace it times out at ':measure:current?'
then the beeper works but the id returns -1.245822E-04.

Also on a side note, is there a way to ask the keithley to wait between command? eg beep(), wait x seconds, beep()?
I've tried sleep in python but it doesn't do it correctly when in a function.

Thanks
Z

apw745
Posts: 6
Joined: April 5th, 2021, 7:36 am
Country: United Kingdom

Re: VI_ERROR_TMO (-1073807339): Timeout expired before operation completed

Post by apw745 » April 21st, 2021, 2:15 am

I can see there is a TSP delay function but I'm unsure which of the SCPI commands is the equivalent.

apw745
Posts: 6
Joined: April 5th, 2021, 7:36 am
Country: United Kingdom

Re: VI_ERROR_TMO (-1073807339): Timeout expired before operation completed

Post by apw745 » May 12th, 2021, 1:59 am

To fix this problem I set pyvisa timeout to 'None'

Post Reply

Return to “2450/2460/2461/2470 Touchscreen SourceMeter”

Who is online

Users browsing this forum: No registered users and 2 guests