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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CST
labcode
Commits
e4cc738b
Commit
e4cc738b
authored
3 months ago
by
Alexandros Asonitis
Browse files
Options
Downloads
Patches
Plain Diff
custom sweep measurement part 1
parent
05f43ea8
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
hp4155/Custom_SMU/lib/help.py
+32
-0
32 additions, 0 deletions
hp4155/Custom_SMU/lib/help.py
hp4155/Custom_SMU/main.py
+155
-45
155 additions, 45 deletions
hp4155/Custom_SMU/main.py
hp4155/Custom_SMU/test_interface.ipynb
+4
-4
4 additions, 4 deletions
hp4155/Custom_SMU/test_interface.ipynb
with
191 additions
and
49 deletions
hp4155/Custom_SMU/lib/help.py
0 → 100644
+
32
−
0
View file @
e4cc738b
# Check the functionalities of smus VAR1,VAR2 and VARD
def
check_sweep_func
(
smus
:
list
,
func
:
str
):
for
i
,
smu
in
enumerate
(
smus
):
if
smu
[
"
func
"
]
==
func
:
return
True
return
False
# Check if there is a pulsed smu for sweep smu
def
check_sweep_pulse
(
smus
:
list
):
for
smu
in
smus
:
if
"
PULSE
"
in
smu
[
"
mode
"
]:
return
True
:
return
False
# Check if there any constant smus and return their numbers
def
check_sweep_cons
(
smus
:
list
):
cons_smu_numbers
=
[]
for
i
,
smu
in
enumerate
(
smus
):
if
smu
[
'
func
'
]
==
'
CONS
'
and
smu
[
'
mode
'
]
!=
'
COMM
'
:
# Non Grounded SMUs
cons_smu_numbers
.
append
(
i
+
1
)
# for the actual number of smus
return
cons_smu_numbers
# Setup the axes in tool
def
setup_axes
(
axes_info
:
list
,
device
):
axes_plot
=
[
'
X
'
,
'
Y1
'
,
'
Y2
'
]
for
ax_plot
,
ax_info
in
zip
(
axes_plot
,
axes_info
):
if
ax_plot
==
'
Y2
'
and
ax_info
[
'
name
'
]
==
""
:
# Y2 axis can be empty
pass
else
:
device
.
display_variable
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
hp4155/Custom_SMU/main.py
+
155
−
45
View file @
e4cc738b
...
@@ -24,30 +24,62 @@ output = widgets.Output()
...
@@ -24,30 +24,62 @@ output = widgets.Output()
display
(
start
,
output
)
display
(
start
,
output
)
#
device = hp4155a.HP4155a('GPIB0::17::INSTR')
device
=
hp4155a
.
HP4155a
(
'
GPIB0::17::INSTR
'
)
def
on_start_clicked
(
b
):
def
on_start_clicked
(
b
):
with
output
:
with
output
:
change_state
(
first_page
,
second_page
,
third_page
,
fourth_page
,
fifth_page
)
change_state
(
first_page
,
second_page
,
third_page
,
fourth_page
,
fifth_page
)
# Step 1 create the dictionaries
#first page
# Reset the device
device
.
reset
()
# Step 1 create the dictionaries appropriately for every measurement
# read general information
measurement_mode
=
third_page
[
0
,
0
].
value
measurement_name
=
fifth_page
[
0
,
0
].
value
processing_nr
=
fifth_page
[
1
,
0
].
value
sample_series
=
fifth_page
[
2
,
0
].
value
dut
=
fifth_page
[
3
,
0
].
value
integration
=
third_page
[
0
,
1
].
value
# we need constant smus for all measurements
# Constant Smus
cons_smus
=
[]
for
j
in
range
(
1
,
5
):
cons_smus
.
append
(
create_dict
(
value
=
third_page
[
21
,
j
].
value
,
comp
=
third_page
[
22
,
j
].
value
))
# first sweep
if
measurement_mode
==
'
SWEEP
'
:
#page 1
smus
=
[]
smus
=
[]
#iterate over the rows
#iterate over the rows
for
i
in
range
(
1
,
5
):
for
i
in
range
(
1
,
5
):
smus
.
append
(
create_dict
(
vname
=
first_page
[
i
,
1
].
value
,
iname
=
first_page
[
i
,
2
].
value
,
mode
=
first_page
[
i
,
3
].
value
,
func
=
first_page
[
i
,
4
].
value
,
disabled
=
first_page
[
i
,
5
].
value
))
smus
.
append
(
create_dict
(
vname
=
first_page
[
i
,
1
].
value
,
# second page
iname
=
first_page
[
i
,
2
].
value
,
mode
=
first_page
[
i
,
3
].
value
,
func
=
first_page
[
i
,
4
].
value
,
disabled
=
first_page
[
i
,
5
].
value
)
)
# 2nd page
user_functions
=
[]
user_functions
=
[]
#iterate over the rows
#iterate over the rows
for
i
in
range
(
1
,
7
):
for
i
in
range
(
1
,
7
):
user_functions
.
append
(
create_dict
(
name
=
second_page
[
i
,
0
].
value
,
unit
=
second_page
[
i
,
1
].
value
,
expression
=
second_page
[
i
,
2
].
value
))
user_functions
.
append
(
create_dict
(
name
=
second_page
[
i
,
0
].
value
,
unit
=
second_page
[
i
,
1
].
value
,
expression
=
second_page
[
i
,
2
].
value
)
)
# third_page
# Page 3
measurement_mode
=
third_page
[
0
,
0
].
value
integration
=
third_page
[
0
,
1
].
value
stress_duration
=
third_page
[
0
,
2
].
value
#match hysteris checkbox with the command forwarded to the tool
#match hysteris checkbox with the command forwarded to the tool
if
third_page
[
9
,
0
].
value
==
True
:
if
third_page
[
9
,
0
].
value
==
True
:
...
@@ -55,35 +87,113 @@ def on_start_clicked(b):
...
@@ -55,35 +87,113 @@ def on_start_clicked(b):
else
:
else
:
hyst
=
'
SING
'
hyst
=
'
SING
'
var1
=
create_dict
(
start
=
third_page
[
4
,
0
].
value
,
stop
=
third_page
[
5
,
0
].
value
,
step
=
third_page
[
6
,
0
].
value
,
comp
=
third_page
[
7
,
0
].
value
,
pcomp
=
third_page
[
8
,
0
].
value
,
mode
=
hyst
)
var1
=
create_dict
(
var2
=
create_dict
(
start
=
third_page
[
4
,
1
].
value
,
stop
=
third_page
[
5
,
1
].
value
,
points
=
third_page
[
6
,
1
].
value
,
comp
=
third_page
[
7
,
1
].
value
,
pcomp
=
third_page
[
8
,
1
])
start
=
third_page
[
4
,
0
].
value
,
vard
=
create_dict
(
offset
=
third_page
[
4
,
2
].
value
,
ratio
=
third_page
[
5
,
2
].
value
,
comp
=
third_page
[
7
,
2
].
value
,
pcomp
=
third_page
[
8
,
2
].
value
)
stop
=
third_page
[
5
,
0
].
value
,
pulse
=
create_dict
(
period
=
third_page
[
4
,
3
].
value
,
width
=
third_page
[
5
,
3
].
value
,
base
=
third_page
[
6
,
3
].
value
)
step
=
third_page
[
6
,
0
].
value
,
comp
=
third_page
[
7
,
0
].
value
,
pcomp
=
third_page
[
8
,
0
].
value
,
#sampling and stress parameters
mode
=
hyst
parameters
=
create_dict
(
mode
=
third_page
[
12
,
0
].
value
,
interval
=
third_page
[
13
,
0
].
value
,
hold
=
third_page
[
16
,
0
].
value
,
points
=
third_page
[
14
,
0
].
value
,
filter
=
third_page
[
17
,
0
].
value
)
)
duration
=
third_page
[
13
,
0
].
value
var2
=
create_dict
(
start
=
third_page
[
4
,
1
].
value
,
stop
=
third_page
[
5
,
1
].
value
,
points
=
third_page
[
6
,
1
].
value
,
comp
=
third_page
[
7
,
1
].
value
,
pcomp
=
third_page
[
8
,
1
]
)
vard
=
create_dict
(
offset
=
third_page
[
4
,
2
].
value
,
ratio
=
third_page
[
5
,
2
].
value
,
comp
=
third_page
[
7
,
2
].
value
,
pcomp
=
third_page
[
8
,
2
].
value
)
pulse
=
create_dict
(
period
=
third_page
[
4
,
3
].
value
,
width
=
third_page
[
5
,
3
].
value
,
base
=
third_page
[
6
,
3
].
value
)
# Constant Smus
cons_smus
=
[]
for
j
in
range
(
1
,
5
):
cons_smus
.
append
(
create_dict
(
value
=
third_page
[
21
,
j
].
value
,
comp
=
third_page
[
22
,
j
].
value
))
# Page 4
# Page 4
axes
=
[]
# 0 is x-axis , 1 is y1-axis and 2 is y2-axis
axes
=
[]
# 0 is x-axis , 1 is y1-axis and 2 is y2-axis
for
j
in
range
(
1
,
4
):
#iterate over the column
for
j
in
range
(
1
,
4
):
#iterate over the column
axes
.
append
(
create_dict
(
name
=
fourth_page
[
1
,
j
].
value
,
scale
=
fourth_page
[
2
,
j
].
value
,
min
=
fourth_page
[
3
,
j
].
value
,
max
=
fourth_page
[
4
,
j
].
value
))
axes
.
append
(
create_dict
(
name
=
fourth_page
[
1
,
j
].
value
,
scale
=
fourth_page
[
2
,
j
].
value
,
min
=
fourth_page
[
3
,
j
].
value
,
max
=
fourth_page
[
4
,
j
].
value
)
)
# Page 5
# Page 5
measurement_name
=
fifth_page
[
0
,
0
].
value
processing_nr
=
fifth_page
[
1
,
0
].
value
sample_series
=
fifth_page
[
2
,
0
].
value
dut
=
fifth_page
[
3
,
0
].
value
variables
=
[]
variables
=
[]
for
i
in
range
(
8
):
for
i
in
range
(
8
):
variables
.
append
(
create_dict
(
name
=
fifth_page
[
6
+
i
,
0
].
value
,
unit
=
fifth_page
[
6
+
i
,
1
].
value
))
variables
.
append
(
create_dict
(
name
=
fifth_page
[
6
+
i
,
0
].
value
,
unit
=
fifth_page
[
6
+
i
,
1
].
value
)
)
# Now execute measurement
#setup sweep measurement mode
device
.
measurement_mode
(
'
SWE
'
)
#disable all irrelevant units
device
.
disable_not_smu
()
# First Setup Smus
for
i
,
smu
in
enumerate
(
smus
):
if
smu
[
'
disabled
'
]
==
False
:
device
.
setup_smu
(
i
+
1
,
smu
)
else
:
#disabled
device
.
smu_disable
(
i
+
1
)
# Setup User Functions
for
user_function
in
user_functions
:
device
.
user_function
(
user_function
[
'
name
'
],
user_function
[
'
unit
'
],
user_function
[
'
expression
'
])
# Setup VAR1 (always in sweep measurements)
device
.
setup_var1
(
var1
)
# device will check for errors
# Now set the 3 additional columns
if
check_sweep_func
(
smus
,
'
VAR2
'
)
==
True
:
device
.
setup_var2
(
var2
)
if
check_sweep_func
(
smus
,
'
VARD
'
)
==
True
:
device
.
setup_vard
(
vard
)
if
check_sweep_pulse
(
smus
)
==
True
:
device
.
setup_pulse
(
pulse
)
# Check for constant SMUs but not grounded
cons_smu_numbers
=
check_sweep_cons
(
smus
)
for
i
,
cons_smu
in
enumerate
(
smus
):
if
i
+
1
in
cons_smu_numbers
:
# check if the constant smu was found in the first page func
device
.
setup_cons_smu
(
i
+
1
,
cons_smu
)
# Now set the axes
# Set X-axis
device
.
display_variable
(
'
X
'
,
axes
[
0
][
'
name
'
])
device
.
axis_scale
(
''
)
# Sampling Measurement Mode
elif
measurement_mode
==
'
SAMPLING
'
:
# sampling parameters
parameters
=
create_dict
(
mode
=
third_page
[
12
,
0
].
value
,
interval
=
third_page
[
13
,
0
].
value
,
hold
=
third_page
[
16
,
0
].
value
,
points
=
third_page
[
14
,
0
].
value
,
filter
=
third_page
[
17
,
0
].
value
)
duration
=
third_page
[
13
,
0
].
value
...
...
This diff is collapsed.
Click to expand it.
hp4155/Custom_SMU/test_interface.ipynb
+
4
−
4
View file @
e4cc738b
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
{
{
"data": {
"data": {
"application/vnd.jupyter.widget-view+json": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "
881e72368c0d4a38a12413a23d573b7d
",
"model_id": "
5fc385773f324e7e8311f6f3ee1528f2
",
"version_major": 2,
"version_major": 2,
"version_minor": 0
"version_minor": 0
},
},
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
{
{
"data": {
"data": {
"application/vnd.jupyter.widget-view+json": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "
b63db9b2c25d444eb3d18bc611032968
",
"model_id": "
abd9668c0feb4d8da9566970b335cd5d
",
"version_major": 2,
"version_major": 2,
"version_minor": 0
"version_minor": 0
},
},
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
{
{
"data": {
"data": {
"application/vnd.jupyter.widget-view+json": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "
f88cceabc2954893adb3528ea5aa9307
",
"model_id": "
ab085a875eae4ea48042af2fcc1c5b49
",
"version_major": 2,
"version_major": 2,
"version_minor": 0
"version_minor": 0
},
},
...
@@ -78,7 +78,7 @@
...
@@ -78,7 +78,7 @@
"name": "python",
"name": "python",
"nbconvert_exporter": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"pygments_lexer": "ipython3",
"version": "3.1
1.4
"
"version": "3.1
2.0
"
}
}
},
},
"nbformat": 4,
"nbformat": 4,
...
...
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