Skip to content
Snippets Groups Projects
Commit 58383bec authored by JupyterHub User's avatar JupyterHub User
Browse files

implementened single step CTLM with no plots/ csv file

parent 8a4d5b9c
No related branches found
No related tags found
No related merge requests found
# this is a python file that minimizes the amount of code seen to the user
import module
import matplotlib.pyplot as plt
import pandas as pd
from datetime import datetime
def I_V_Measurement(start,stop,step):
device = module.HP4155a('GPIB0::17::INSTR')
device.inst.write(":PAGE:MEAS")
device.inst.write(":PAGE:CHAN:MODE SWEEP") #go to sweep page and prepare sweep measurement
device.reset()
#setup sweep
device.inst.write(":PAGE:CHAN:MODE SWEEP") #go to sweep page and prepare sweep measurement
#smu2 and smu4 are disabled
device.smu_disable_sweep(2)
device.smu_disable_sweep(4)
#smu1 is constant and common
device.smu_mode_meas(1,'COMM')
device.smu_function_sweep(1,'CONS')
#smu3 is VAR1 and V
device.smu_mode_meas(3,'V')
device.smu_function_sweep(3,'VAR1')
#define start-step-stop
device.start_value_sweep(start)
device.step_sweep(step)
device.stop_value_sweep(stop)
#start measurement
device.single_measurement()
while device.operation_completed() == False:
pass
voltage_values = device.return_data('V3')
current_values = device.return_data('I3')
# show plot
plt.plot(voltage_values,current_values)
plt.show()
#export data to csv file
#add title to the results
header = ['Voltage(V)', 'Current(A)']
data = {header[0]:voltage_values,header[1]:current_values}
df = pd.DataFrame(data)
date = str(datetime.today().replace(microsecond=0))
print(df)
#exporting the data frame in an excel file
file_name = 'results_'+date+'.csv'
df.to_csv(file_name)
del device
def stress_sampling():
#connect to device
device = module.HP4155a('GPIB0::17::INSTR')
device.reset()
device.stress_page()
#define smus to numbers in mode and values for stress
#mode
device.smu_mode(1,'COMM')
device.smu_mode(2,'V')
device.smu_mode(3,'V')
device.smu_mode(4,'COMM')
device.sync(4,0)
#values
device.smu_value(2,10)
device.smu_value(3,-3)
#time
zeit=device.stress_time(30)
device.start_stress()
while device.operation_completed() == False:
pass
#start with sampling measurement
device.measurement_mode('SAMP')
#set the mode of smus for sampling
device.smu_mode_meas(1,'COMM')
device.smu_mode_meas(2,'V')
device.smu_mode_meas(3,'V')
device.smu_mode_meas(4,'COMM')
#set the values of smu for sampling
device.constant_smu_sampling(2,10)
device.constant_smu_sampling(3,2)
#time log10
device.sampling_mode('L10')
#minimum initial interval
#device.initial_interval('MIN')
device.number_of_points(21)
device.integration_time('SHOR')
device.single_measurement()
while device.operation_completed() == False:
pass
time_values = device.return_data('@TIME')
I3_values = device.return_data('I3')
I2_values = device.return_data('I2')
fig = plt.figure()
plt.plot(time_values,I2_values)
plt.show()
fig = plt.figure()
plt.plot(time_values,I3_values)
plt.show()
del device
# These are some help functions for the setup of the CTLM measurement
def single_ctlm(time,start=-50*10**(-3),stop=50*10**(-3),step=10**(-3),comp=10V):
device.reset()
device.inst.write(":PAGE:MEAS")
device.inst.write(":PAGE:CHAN:MODE SWEEP") #go to sweep page and prepare sweep measurement
#setup smus
#smu1 is constant and common
device.smu_mode_meas(1,'COMM')
device.smu_function_sweep(1,'CONS')
#smu2 is constant and I
device.smu_mode_meas(2,'I')
device.smu_function_sweep(2,'CONS')
#smu3 is var1 and I
device.smu_mode_meas(3,'I')
device.smu_function_sweep(3,'VAR1')
#smu4 is constant and I
device.smu_mode_meas(4,'I')
device.smu_function_sweep(4,'CONS')
#select compliance of smu3
device.comp('VAR1',comp)
#compliance of smu2 and smu4 is 10V
device.const_comp(2,10)
device.const_comp(4,10)
# smu1 is common and compliance is automatically set to maximum
#integration time
device.integration_time(time)
#define start-step-stop
device.start_value_sweep(start)
device.step_sweep(step)
device.stop_value_sweep(stop)
#start measurement
device.single_measurement()
while device.operation_completed() == False:
pass
voltage_values = device.return_data('V3')
current_values = device.return_data('I3')
resistance_values=[]
for i in range(len(voltage_values)):
resistance_values.append(voltage_values[i]/current_values[i])
\ No newline at end of file
......@@ -129,5 +129,61 @@ def stress_sampling():
plt.plot(time_values,I3_values)
plt.show()
del device
# These are some help functions for the setup of the CTLM measurement
def single_ctlm(time,start=-50*10**(-3),stop=50*10**(-3),step=10**(-3),comp=10V):
device.reset()
device.inst.write(":PAGE:MEAS")
device.inst.write(":PAGE:CHAN:MODE SWEEP") #go to sweep page and prepare sweep measurement
#setup smus
#smu1 is constant and common
device.smu_mode_meas(1,'COMM')
device.smu_function_sweep(1,'CONS')
#smu2 is constant and I
device.smu_mode_meas(2,'I')
device.smu_function_sweep(2,'CONS')
#smu3 is var1 and I
device.smu_mode_meas(3,'I')
device.smu_function_sweep(3,'VAR1')
#smu4 is constant and I
device.smu_mode_meas(4,'I')
device.smu_function_sweep(4,'CONS')
#select compliance of smu3
device.comp('VAR1',comp)
#compliance of smu2 and smu4 is 10V
device.const_comp(2,10)
device.const_comp(4,10)
# smu1 is common and compliance is automatically set to maximum
#integration time
device.integration_time(time)
#define start-step-stop
device.start_value_sweep(start)
device.step_sweep(step)
device.stop_value_sweep(stop)
#start measurement
device.single_measurement()
while device.operation_completed() == False:
pass
voltage_values = device.return_data('V3')
current_values = device.return_data('I3')
resistance_values=[]
for i in range(len(voltage_values)):
resistance_values.append(voltage_values[i]/current_values[i])
\ No newline at end of file
......@@ -139,6 +139,7 @@ class HP4155a(object):
command = f":PAGE:MEAS:SAMP:POIN {number}"
self.inst.write(command)
#integration time is SHOR,MED,LONG
def integration_time(self,time):
command=f":PAGE:MEAS:MSET:ITIM {time}"
self.inst.write(command)
......@@ -184,4 +185,10 @@ class HP4155a(object):
command = f":PAGE:MEAS:{variable}:COMP {value}"
self.inst.write(command)
# constant voltage compiance of an smu(only use if the smu is constant and the mode is not COMMON)
def const_comp(self,smu_number,value):
command = f":PAGE:MEAS:CONS:SMU{smu_number}:COMP {value}"
self.inst.write(command)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment