Skip to content
Snippets Groups Projects
Commit d1a96a0b authored by Alexandros Asonitis's avatar Alexandros Asonitis
Browse files

tested the memristor measurement

parent d14a4e69
Branches
No related tags found
No related merge requests found
[Memristor]
step = 0.02
integration_time='MED'
integration_time=MED
[SET]
voltage=1
......
......@@ -11,6 +11,7 @@ import configparser
from ipyfilechooser import FileChooser
import ipywidgets as widgets
import time
import os
def memristor():
......@@ -165,10 +166,11 @@ def memristor():
file_path = pc.selected
print(f"save results in:{file_path}")
file_name = DUT.value+"_Memristor.txt"
file = os.path.join(file_path,file_name)
#check if file name exists
i=1
while os.path.exists(path):
while os.path.exists(file):
file_name = DUT.value+"_Memristor_"+str(i)+".txt"
file= os.path.join(file_path,file_name)
i=i+1
......@@ -186,7 +188,7 @@ def memristor():
if fc.selected!=None:
ini_file= fc.selected
config = configparser.Configparser()
config = configparser.ConfigParser()
config.read(ini_file)
#read the values
......@@ -194,6 +196,7 @@ def memristor():
if integration_time!='SHOR' and integration_time!='MED' and integration_time!='LONG':
raise Exception('Integration time can be SHOR(short),MED(medium) or LONG(long)')
comp=config.getfloat(process,'comp')
if abs(comp)>1:
raise Exception("current compliance can be from -1A to 1A")
......@@ -259,21 +262,21 @@ def memristor():
if counter == 0:
disable_widgets()
file = initialize_file()
counter=counter+1:
counter=counter+1
#execute measurement,plot results and create dataframe
V12,I12=sweep(0,Vset,step,CC_vset,integration_time)
plot_sweep(V12,I12,'SET')
df=create_data_frame()
df=create_data_frame(V12,I12)
#save results
file=open(file,'a')
title = f"SET Memristor:"+"\n"+f"sample series:{sample_series.value}" +"\n"+f"field:{field.value}"+"\n"+f"DUT:{DUT.value}"+"\n"+f"Set Voltage={VSet}(V)"+"\n"+f"current compliance={CC_vset}(A)"
with open(file, 'a', encoding='utf-8-sig') as f:
title = f"SET Memristor:"+"\n"+f"sample series:{sample_series.value}" +"\n"+f"field:{field.value}"+"\n"+f"DUT:{DUT.value}"+"\n"+f"Set Voltage={Vset}(V)"+"\n"+f"current compliance={CC_vset}(A)"
file.write(title)
file.write(df.to_string())
file.write("\n")
file.close()
f.write(title)
f.write(df.to_string(index=False))
f.write("\n")
#f.close() outside the with block the file is closed
#plot all results if checkbox is clicked
if counter==2 and full.value == True:
......@@ -307,16 +310,16 @@ def memristor():
#execute measurement and plot results and create dataframe
V34,I34=sweep(0,Vreset,step,CC_vreset,integration_time)
plot_sweep(V34,I34,'RESET')
df = create_data_frame()
df = create_data_frame(V34,I34)
#save results
file=open(file,'a')
with open(file, 'a', encoding='utf-8-sig') as f:
title = f"RESET Memristor:"+"\n"+f"sample series:{sample_series.value}" +"\n"+f"field:{field.value}"+"\n"+f"DUT:{DUT.value}"+"\n"+f"Set Voltage={Vreset}(V)"+"\n"+f"current compliance={CC_vreset}(A)"
file.write(title)
file.write(df.to_string())
file.write("\n")
file.close()
f.write(title)
f.write(df.to_string(index=False))
f.write("\n")
#f.close() outside the with block the file is closed
#plot all results if checkbox is clicked
if counter==2 and full.value == True:
......
%% Cell type:code id:33f299ef-2302-4e0a-b45f-291460d944c6 tags:
``` python
from memristor import *
memristor()
```
%% Output
%% Cell type:code id:541c465a-2858-4998-8411-8c06ab4b466c tags:
``` python
```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment