Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
labcode
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CST
labcode
Commits
d1a96a0b
Commit
d1a96a0b
authored
1 year ago
by
Alexandros Asonitis
Browse files
Options
Downloads
Patches
Plain Diff
tested the memristor measurement
parent
d14a4e69
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
hp4155/memristor/default.ini
+1
-1
1 addition, 1 deletion
hp4155/memristor/default.ini
hp4155/memristor/memristor.py
+20
-17
20 additions, 17 deletions
hp4155/memristor/memristor.py
hp4155/memristor/memristor_buttons.ipynb
+66
-2
66 additions, 2 deletions
hp4155/memristor/memristor_buttons.ipynb
with
87 additions
and
20 deletions
hp4155/memristor/default.ini
+
1
−
1
View file @
d1a96a0b
[Memristor]
step
=
0.02
integration_time
=
'
MED
'
integration_time
=
MED
[SET]
voltage
=
1
...
...
This diff is collapsed.
Click to expand it.
hp4155/memristor/memristor.py
+
20
−
17
View file @
d1a96a0b
...
...
@@ -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
.
Config
p
arser
()
config
=
configparser
.
Config
P
arser
()
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=
{
V
S
et
}
(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=
{
V
s
et
}
(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
close
d
#plot all results if checkbox is clicked
if
counter
==
2
and
full
.
value
==
True
:
...
...
This diff is collapsed.
Click to expand it.
hp4155/memristor/memristor_buttons.ipynb
+
66
−
2
View file @
d1a96a0b
...
...
@@ -9,7 +9,63 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "42946b015aef460aa66523c5a4e8b5d1",
"model_id": "172195ee6c384ea98ffa351c16e0c172",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"FileChooser(path='\\\\FILESERVER\\public', filename='', title='', show_hidden=False, select_desc='load .ini', cha…"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "86a5ea9caafd4880a4dbc78596e26178",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"FileChooser(path='\\\\FILESERVER\\public', filename='', title='', show_hidden=False, select_desc='save path', cha…"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "d3a61fd9ef2e4e71a058a6aa14636628",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"VBox(children=(Text(value='', description='sample series:', placeholder='Enter text here:', style=TextStyle(de…"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "de15afd814aa42069f0e6f958f00d276",
"version_major": 2,
"version_minor": 0
},
...
...
@@ -23,7 +79,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "
e42afd4a14144721a8008da00fd87f4
e",
"model_id": "
448106dadda04245abb12225835416f
e",
"version_major": 2,
"version_minor": 0
},
...
...
@@ -40,6 +96,14 @@
"\n",
"memristor()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "541c465a-2858-4998-8411-8c06ab4b466c",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
...
...
%% 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
```
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment