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

implemented I-V measurement (with no transistor) and got results back! Then i...

implemented I-V measurement (with no transistor) and got results back! Then i used matplotlib to visualiye them
parent fd1a82e6
No related branches found
No related tags found
No related merge requests found
...@@ -73,3 +73,20 @@ class HP4155a(object): ...@@ -73,3 +73,20 @@ class HP4155a(object):
def show_variables(self): def show_variables(self):
return self.inst.query(":DATA:CAT?") return self.inst.query(":DATA:CAT?")
#sweep functions
def setup_sweep(self):
self.inst.write(":PAGE:CHAN:MODE SWEEP")
print(self.inst.query(":PAGE:MEAS:VAR1:START?"))
print(self.inst.query(":PAGE:MEAS:VAR1:STOP?"))
''' smu1 is constant and common, SMU3 is controlled through the Var1(v) which has a start value, a stop value, and a step
We don't need SMU2 and SMU4
:PAGE:CHANnels[:CDEFinition]:SMU<n>:FUNCtion this command is used to define the variable of SMU3
:PAGE:CHANnels[:CDEFinition]:SMU<n>:MODE
This command sets the output MODE of SMU<n>. This command also has a query
form. It is different that the one we used for the stress setup.
Important! we dont set a value for smu1.'''
\ No newline at end of file
%% Cell type:code id:d48a45d4-fec7-47d2-ae53-001c372cf79c tags: %% Cell type:code id:d48a45d4-fec7-47d2-ae53-001c372cf79c tags:
``` python ``` python
import pyvisa import pyvisa
class HP4155a(object): class HP4155a(object):
def __init__(self,adress): def __init__(self,adress):
self.adress = adress self.adress = adress
self.rm = pyvisa.ResourceManager() self.rm = pyvisa.ResourceManager()
self.inst = self.rm.open_resource(adress) self.inst = self.rm.open_resource(adress)
def idn(self): def idn(self):
return self.inst.query("*IDN?") return self.inst.query("*IDN?")
def __del__(self): def __del__(self):
self.rm.close() self.rm.close()
def reset(self): def reset(self):
self.inst.write("*RST") self.inst.write("*RST")
#smu mode #smu mode
def smu_mode(self,smu_number,mode): def smu_mode(self,smu_number,mode):
command = f":PAGE:STR:SMU{smu_number}:MODE {mode}" command = f":PAGE:STR:SMU{smu_number}:MODE {mode}"
self.inst.write(command) self.inst.write(command)
#smu constant value for stress measurement #smu constant value for stress measurement
def smu_value(self,smu_number,value): def smu_value(self,smu_number,value):
command =f":PAGE:STR:SET:CONS:SMU{smu_number} {value}" command =f":PAGE:STR:SET:CONS:SMU{smu_number} {value}"
self.inst.write(command) self.inst.write(command)
#set the stess time in seconds #set the stess time in seconds
def stress_time(time): def stress_time(self,time):
command = f":PAGE:STR:SET:DUR {time}" command = f":PAGE:STR:SET:DUR {time}"
self.inst.write(command) self.inst.write(command)
return time return time
#start stress operation #start stress operation
def start_stress(self): def start_stress(self):
#inst.write(":PAGE:SCONtrol:STRess[:STARt]") #inst.write(":PAGE:SCONtrol:STRess[:STARt]")
self.inst.write(":PAGE:SCON:STR") self.inst.write(":PAGE:SCON:STR")
#inst.write("*TRG") #inst.write("*TRG")
self.inst.query('*OPC?') #self.inst.query('*OPC?')
#stop current operation #stop current operation
def stop_operation(self): def stop_operation(self):
self.inst.write(":PAGE:SCONtrol:STOP") self.inst.write(":PAGE:SCONtrol:STOP")
#get data from HP4155a #get data from HP4155a
def get_data(self): def get_data(self):
self.inst.write(":FORM REAL") self.inst.write(":FORM REAL")
data = self.inst.query(":HCOPy:ITEM:ALL:DATA?") data = self.inst.query(":HCOPy:ITEM:ALL:DATA?")
return data return data
def sync(self,smu_number,s): def sync(self,smu_number,s):
if s == 0: if s == 0:
mode = "NSYN" mode = "NSYN"
else: else:
mode="SYNC" mode="SYNC"
command = f":PAGE:STR:SMU{smu_number}:FUNC {mode}" command = f":PAGE:STR:SMU{smu_number}:FUNC {mode}"
self.inst.write(command) self.inst.write(command)
def single_measurement(): def single_measurement(self):
self.inst.write(":PAGE:SCON:SING") self.inst.write(":PAGE:SCON:SING")
#go to stress page
def stress_page(self):
self.inst.write(":PAGE:STR")
def error(self):
return self.inst.query(":SYST:ERR?")
def operation_completed(self):
return self.inst.query('*OPC?')
def show_variables(self):
return self.inst.query(":DATA:CAT?")
#sweep functions
def smu_disable_sweep(self,number):
command= f":PAGE:CHAN:SMU{number}:DIS"
self.inst.write(command)
def smu_mode_sweep(self,number,mode):
command=f":PAGE:CHAN:SMU{number}:MODE {mode}"
self.inst.write(command)
def smu_function_sweep(self,number,function):
command=f":PAGE:CHAN:SMU{number}:FUNC {function}"
self.inst.write(command)
def start_value_sweep(self,value):
command=f":PAGE:MEAS:VAR1:START {value}"
self.inst.write(command)
def step_sweep(self,value):
command=f":PAGE:MEAS:VAR1:STEP {value}"
self.inst.write(command)
def stop_value_sweep(self,value):
command=f":PAGE:MEAS:VAR1:STOP {value}"
self.inst.write(command)
''' smu1 is constant and common, SMU3 is controlled through the Var1(v) which has a start value, a stop value, and a step
We don't need SMU2 and SMU4
:PAGE:CHANnels[:CDEFinition]:SMU<n>:FUNCtion this command is used to define the variable of SMU3
:PAGE:CHANnels[:CDEFinition]:SMU<n>:MODE
This command sets the output MODE of SMU<n>. This command also has a query
form. It is different that the one we used for the stress setup.
:PAGE:CHANnels[:CDEFinition]:SMU<n>:DISable
Important! we dont set a value for smu1.'''
``` ```
%% Cell type:code id:e783c02a-14a6-4272-b716-e7b1d0fbaac2 tags: %% Cell type:code id:e783c02a-14a6-4272-b716-e7b1d0fbaac2 tags:
``` python ``` python
``` ```
......
This diff is collapsed.
No preview for this file type
...@@ -75,11 +75,29 @@ class HP4155a(object): ...@@ -75,11 +75,29 @@ class HP4155a(object):
return self.inst.query(":DATA:CAT?") return self.inst.query(":DATA:CAT?")
#sweep functions #sweep functions
def smu_disable_sweep(self,number):
command= f":PAGE:CHAN:SMU{number}:DIS"
self.inst.write(command)
def smu_mode_sweep(self,number,mode):
command=f":PAGE:CHAN:SMU{number}:MODE {mode}"
self.inst.write(command)
def setup_sweep(self): def smu_function_sweep(self,number,function):
self.inst.write(":PAGE:CHAN:MODE SWEEP") command=f":PAGE:CHAN:SMU{number}:FUNC {function}"
self.inst.query(":PAGE:MEAS:VAR1:START?") self.inst.write(command)
self.inst.query(":PAGE:MEAS:VAR1:STOP?")
def start_value_sweep(self,value):
command=f":PAGE:MEAS:VAR1:START {value}"
self.inst.write(command)
def step_sweep(self,value):
command=f":PAGE:MEAS:VAR1:STEP {value}"
self.inst.write(command)
def stop_value_sweep(self,value):
command=f":PAGE:MEAS:VAR1:STOP {value}"
self.inst.write(command)
''' smu1 is constant and common, SMU3 is controlled through the Var1(v) which has a start value, a stop value, and a step ''' smu1 is constant and common, SMU3 is controlled through the Var1(v) which has a start value, a stop value, and a step
We don't need SMU2 and SMU4 We don't need SMU2 and SMU4
...@@ -88,5 +106,5 @@ class HP4155a(object): ...@@ -88,5 +106,5 @@ class HP4155a(object):
:PAGE:CHANnels[:CDEFinition]:SMU<n>:MODE :PAGE:CHANnels[:CDEFinition]:SMU<n>:MODE
This command sets the output MODE of SMU<n>. This command also has a query This command sets the output MODE of SMU<n>. This command also has a query
form. It is different that the one we used for the stress setup. form. It is different that the one we used for the stress setup.
:PAGE:CHANnels[:CDEFinition]:SMU<n>:DISable
Important! we dont set a value for smu1. Important! we dont set a value for smu1.'''
\ No newline at end of file \ No newline at end of file
...@@ -208,7 +208,7 @@ ...@@ -208,7 +208,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.9.7" "version": "3.11.4"
} }
}, },
"nbformat": 4, "nbformat": 4,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment