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

measurement results tlm/ctlm

parent 362b3ff4
No related branches found
No related tags found
No related merge requests found
{
"cells": [],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 5
}
%% Cell type:code id:35327262-4233-4047-afc9-2059ed9317a0 tags:
``` python
import measurements
from measurements import *
tlm_final(55)
```
%% Output
C:\Users\user\labcode\hp4155\measurements.py:383: UserWarning: The figure layout has changed to tight
fig.tight_layout()
Voltage(V) Current(A) Resistance(Ohm)
0 -3.387388 -0.050 78.488
1 -3.308900 -0.049 78.729
2 -3.229930 -0.048 78.324
3 -3.152252 -0.047 77.743
4 -3.074444 -0.046 77.526
.. ... ... ...
96 3.080750 0.046 78.385
97 3.159534 0.047 79.234
98 3.239218 0.048 79.704
99 3.318942 0.049 80.584
100 3.400386 0.050 81.444
[101 rows x 3 columns]
Press enter to continue or anything else to stop the programm:
%% Cell type:code id:65c260e9-396b-45fb-a923-b505600d2172 tags:
``` python
```
No preview for this file type
No preview for this file type
%% Cell type:code id:44cebdf0-d79f-4c34-83c0-ed74f9eb3cf9 tags: %% Cell type:code id:44cebdf0-d79f-4c34-83c0-ed74f9eb3cf9 tags:
``` python ``` python
import module import module
``` ```
%% Cell type:code id:b1a01977-062f-4bf2-8539-743a9fbcc10b tags: %% Cell type:code id:b1a01977-062f-4bf2-8539-743a9fbcc10b tags:
``` python ``` python
device = module.HP4155a('GPIB0::17::INSTR') device = module.HP4155a('GPIB0::17::INSTR')
``` ```
%% Cell type:code id:28c660ec-3c79-4075-aa6c-e4b7078a199f tags: %% Cell type:code id:28c660ec-3c79-4075-aa6c-e4b7078a199f tags:
``` python ``` python
device.show_variables() device.show_variables()
``` ```
%% Output %% Output
'q,k,e,@PGT,@PGD,@PG1W,@PG2W,@PG1DL,@PG2DL,@PG1B,@PG2B,@PG1LD,@PG2LD,@PG1TR,@PG2TR,@TIME,@INDEX,@MX,@MY,@MY1,@MY2,@MI,@CX,@CY,@CY1,@CY2,@L1X,@L1Y,@L1Y1,@L1Y2,@L2X,@L2Y,@L2Y1,@L2Y2,@L1G,@L1G1,@L1G2,@L2G,@L2G1,@L2G2,@IX,@IY,@IY1,@IY2,@L1CO,@L2CO,V1,V2,V3,V4,I1,I2,I3,I4,I,V,R\n' 'q,k,e,@PGT,@PGD,@PG1W,@PG2W,@PG1DL,@PG2DL,@PG1B,@PG2B,@PG1LD,@PG2LD,@PG1TR,@PG2TR,@TIME,@INDEX,@MX,@MY,@MY1,@MY2,@MI,@CX,@CY,@CY1,@CY2,@L1X,@L1Y,@L1Y1,@L1Y2,@L2X,@L2Y,@L2Y1,@L2Y2,@L1G,@L1G1,@L1G2,@L2G,@L2G1,@L2G2,@IX,@IY,@IY1,@IY2,@L1CO,@L2CO,V1,V2,V3,V4,I1,I2,I3,I4,I,V,R\n'
%% Cell type:code id:773d5cc4-4830-48f8-9ef8-e14d8a726ed1 tags: %% Cell type:code id:773d5cc4-4830-48f8-9ef8-e14d8a726ed1 tags:
``` python ``` python
device.inst.write(":PAGE:CHAN:MODE SWEEP") #go to sweep page and prepare sweep measurement device.inst.write(":PAGE:CHAN:MODE SWEEP") #go to sweep page and prepare sweep measurement
``` ```
%% Output %% Output
23 23
%% Cell type:code id:4f6ddac9-8ef2-4afd-8419-3f9eb35247dc tags: %% Cell type:code id:4f6ddac9-8ef2-4afd-8419-3f9eb35247dc tags:
``` python ``` python
device.reset() device.reset()
``` ```
%% Output
---------------------------------------------------------------------------
InvalidSession Traceback (most recent call last)
Cell In[5], line 1
----> 1 device.reset()
File ~\labcode\hp4155\module.py:18, in HP4155a.reset(self)
17 def reset(self):
---> 18 self.inst.write("*RST")
File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyvisa\resources\messagebased.py:197, in MessageBasedResource.write(self, message, termination, encoding)
191 warnings.warn(
192 "write message already ends with " "termination characters",
193 stacklevel=2,
194 )
195 message += term
--> 197 count = self.write_raw(message.encode(enco))
199 return count
File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyvisa\resources\messagebased.py:157, in MessageBasedResource.write_raw(self, message)
143 def write_raw(self, message: bytes) -> int:
144 """Write a byte message to the device.
145
146 Parameters
(...)
155
156 """
--> 157 return self.visalib.write(self.session, message)[0]
File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyvisa\resources\resource.py:171, in Resource.session(self)
162 """Resource session handle.
163
164 Raises
(...)
168
169 """
170 if self._session is None:
--> 171 raise errors.InvalidSession()
172 return self._session
InvalidSession: Invalid session handle. The resource might be closed.
%% Cell type:code id:4d0f1206-743b-40c5-839b-35cfc619fd83 tags: %% Cell type:code id:4d0f1206-743b-40c5-839b-35cfc619fd83 tags:
``` python ``` python
''' some instructions for the measurement setup ''' some instructions for the measurement setup
smu1 is constant and common(GND) smu1 is constant and common(GND)
smu2 is constant and mode I(2) smu2 is constant and mode I(2)
smu3 is VAR1 and mode I(S) smu3 is VAR1 and mode I(S)
smu4 is constant and mode I(4) smu4 is constant and mode I(4)
we calculate the difference between i4-i2 we calculate the difference between i4-i2
''' '''
``` ```
%% Cell type:code id:7ea283a7-827d-4194-a7c4-7f05fec34339 tags: %% Cell type:code id:7ea283a7-827d-4194-a7c4-7f05fec34339 tags:
``` python ``` python
device.inst.query(":PAGE:MEAS:VAR1:COMP?") device.inst.query(":PAGE:MEAS:VAR1:COMP?")
``` ```
%% Output %% Output
'+1.000000E+001\n' '+1.000000E+001\n'
%% Cell type:code id:6aa55567-d9ca-44c1-8121-2aa58031da68 tags: %% Cell type:code id:6aa55567-d9ca-44c1-8121-2aa58031da68 tags:
``` python ``` python
''' '''
smu2 and smu4 have current zero smu2 and smu4 have current zero
the line of voltage=0 returns if the line of voltage=0 returns if
''' '''
device.inst.query(":PAGE:CHAN:UFUN:CAT?") device.inst.query(":PAGE:CHAN:UFUN:CAT?")
``` ```
%% Output %% Output
'+3,I,V,R\n' '+3,I,V,R\n'
%% Cell type:code id:86186b8c-87ab-43f3-97aa-b564ef35e7a3 tags: %% Cell type:code id:86186b8c-87ab-43f3-97aa-b564ef35e7a3 tags:
``` python ``` python
device.inst.query(":PAGE:DISP:DVAR?") device.inst.query(":PAGE:DISP:DVAR?")
``` ```
%% Output %% Output
'\n' '\n'
%% Cell type:code id:d4dab174-5f7c-42c3-b46c-5fc234a3e414 tags: %% Cell type:code id:d4dab174-5f7c-42c3-b46c-5fc234a3e414 tags:
``` python ``` python
''' from this command the data variable v4-v2 is displayed ''' from this command the data variable v4-v2 is displayed
idea: v4-v2 is zero when two smus have created a shortcut idea: v4-v2 is zero when two smus have created a shortcut
''' '''
voltage=device.return_data('V') voltage=device.return_data('V')
``` ```
%% Output %% Output
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
UnicodeDecodeError Traceback (most recent call last) UnicodeDecodeError Traceback (most recent call last)
Cell In[6], line 5 Cell In[6], line 5
1 ''' from this command the data variable v4-v2 is displayed 1 ''' from this command the data variable v4-v2 is displayed
2 idea: v4-v2 is zero when two smus have created a shortcut 2 idea: v4-v2 is zero when two smus have created a shortcut
3 ''' 3 '''
----> 5 voltage=device.return_data('V') ----> 5 voltage=device.return_data('V')
File ~\labcode\hp4155\module.py:168, in HP4155a.return_data(self, variable) File ~\labcode\hp4155\module.py:168, in HP4155a.return_data(self, variable)
164 def return_data(self, variable): 164 def return_data(self, variable):
165 165
166 #send command to instrument returns a string of comma seperated values 166 #send command to instrument returns a string of comma seperated values
167 command = f":DATA? '{variable}'" 167 command = f":DATA? '{variable}'"
--> 168 data = self.inst.query(command) --> 168 data = self.inst.query(command)
170 # separate the string to a list of strings 170 # separate the string to a list of strings
171 values = data.replace("\n",",").split(",") 171 values = data.replace("\n",",").split(",")
File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyvisa\resources\messagebased.py:648, in MessageBasedResource.query(self, message, delay) File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyvisa\resources\messagebased.py:648, in MessageBasedResource.query(self, message, delay)
645 if delay > 0.0: 645 if delay > 0.0:
646 time.sleep(delay) 646 time.sleep(delay)
--> 648 return self.read() --> 648 return self.read()
File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyvisa\resources\messagebased.py:486, in MessageBasedResource.read(self, termination, encoding) File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyvisa\resources\messagebased.py:486, in MessageBasedResource.read(self, termination, encoding)
484 if termination is None: 484 if termination is None:
485 termination = self._read_termination 485 termination = self._read_termination
--> 486 message = self._read_raw().decode(enco) --> 486 message = self._read_raw().decode(enco)
487 else: 487 else:
488 with self.read_termination_context(termination): 488 with self.read_termination_context(termination):
UnicodeDecodeError: 'ascii' codec can't decode byte 0x83 in position 9: ordinal not in range(128) UnicodeDecodeError: 'ascii' codec can't decode byte 0x83 in position 9: ordinal not in range(128)
%% Cell type:code id:419bca96-97ca-47ba-876b-2b3a99722a68 tags: %% Cell type:code id:419bca96-97ca-47ba-876b-2b3a99722a68 tags:
``` python ``` python
device.operation_completed() device.operation_completed()
``` ```
%% Output %% Output
True True
%% Cell type:code id:7e49a29b-6261-4b0f-8fb2-fbeaedf604a7 tags: %% Cell type:code id:7e49a29b-6261-4b0f-8fb2-fbeaedf604a7 tags:
``` python ``` python
device.inst.query(":PAGE:MEAS:MSET:ITIM?") device.inst.query(":PAGE:MEAS:MSET:ITIM?")
``` ```
%% Output %% Output
'MED\n' 'MED\n'
%% Cell type:code id:2ddb04ba-1368-4443-94e6-6440c772899b tags: %% Cell type:code id:2ddb04ba-1368-4443-94e6-6440c772899b tags:
``` python ``` python
''' '''
measurement range has range limited 1nA gnd measurement range has range limited 1nA gnd
auto for smu2 and 4 auto for smu2 and 4
limited 2v for smu3 limited 2v for smu3
default wait time 1 default wait time 1
shor 640 microsecond 0,032 shor 640 microsecond 0,032
med 20ms 1 med 20ms 1
long 320ms 16 long 320ms 16
''' '''
``` ```
%% Output %% Output
'\nmeasurement range has range limited 1nA gnd\nauto for smu2 and 4\nlimited 2v for smu3\n\ndefault wait time 1\n\nshor 640 microsecond 0,032\nmed 20ms 1\nlong 320ms 16\n' '\nmeasurement range has range limited 1nA gnd\nauto for smu2 and 4\nlimited 2v for smu3\n\ndefault wait time 1\n\nshor 640 microsecond 0,032\nmed 20ms 1\nlong 320ms 16\n'
%% Cell type:code id:076df1d7-3df7-4355-9503-585847927a93 tags: %% Cell type:code id:076df1d7-3df7-4355-9503-585847927a93 tags:
``` python ``` python
del device del device
``` ```
%% Output %% Output
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
NameError Traceback (most recent call last) NameError Traceback (most recent call last)
Cell In[10], line 1 Cell In[10], line 1
----> 1 del device ----> 1 del device
NameError: name 'device' is not defined NameError: name 'device' is not defined
%% Cell type:code id:dae1e02e-3e61-4a56-9c23-643d45d2892c tags: %% Cell type:code id:dae1e02e-3e61-4a56-9c23-643d45d2892c tags:
``` python ``` python
device.inst.query(":PAGE:MEAS:SWE:VAR1:COMP?") device.inst.query(":PAGE:MEAS:SWE:VAR1:COMP?")
``` ```
%% Output %% Output
'+1.000000E+001\n' '+1.000000E+001\n'
%% Cell type:code id:1b16de43-8777-4051-b9e0-cdcce4edfb1c tags: %% Cell type:code id:1b16de43-8777-4051-b9e0-cdcce4edfb1c tags:
``` python ``` python
``` ```
......
...@@ -282,6 +282,9 @@ def tlm_final(innen=0,distances=(5,10,15,25,45),field_name ='M00',start=-50*10** ...@@ -282,6 +282,9 @@ def tlm_final(innen=0,distances=(5,10,15,25,45),field_name ='M00',start=-50*10**
#initialize figure #initialize figure
fig, (ax1, ax2) = plt.subplots(2,sharex=True,figsize=(8,6)) #the plots share the same x axis fig, (ax1, ax2) = plt.subplots(2,sharex=True,figsize=(8,6)) #the plots share the same x axis
if innen==0:
fig.suptitle('TLM plot')
else:
fig.suptitle('CTLM plot') fig.suptitle('CTLM plot')
ax1.set_title('I(V)') ax1.set_title('I(V)')
ax1.set(xlabel='Voltage(V)',ylabel='Current(A)') ax1.set(xlabel='Voltage(V)',ylabel='Current(A)')
...@@ -347,12 +350,12 @@ def tlm_final(innen=0,distances=(5,10,15,25,45),field_name ='M00',start=-50*10** ...@@ -347,12 +350,12 @@ def tlm_final(innen=0,distances=(5,10,15,25,45),field_name ='M00',start=-50*10**
device.display_variable('Y2','R') device.display_variable('Y2','R')
###-----------------------------autoscaling after measurement------------------------------------------------------------------------------ ###-----------------------------autoscaling after measurement------------------------------------------------------------------------------
#device.display_variable_min_max('X','MIN',-comp) device.display_variable_min_max('X','MIN',-comp)
#device.display_variable_min_max('X','MAX',comp) device.display_variable_min_max('X','MAX', comp)
#device.display_variable_min_max('Y1','MIN',start) device.display_variable_min_max('Y1','MIN',start)
#device.display_variable_min_max('Y1','MAX',stop) device.display_variable_min_max('Y1','MAX',stop)
#device.display_variable_min_max('Y2','MIN',0) device.display_variable_min_max('Y2','MIN',0)
#device.display_variable_min_max('Y2','MAX',200) device.display_variable_min_max('Y2','MAX',200)
#start measurement #start measurement
device.single_measurement() device.single_measurement()
...@@ -427,7 +430,7 @@ def tlm_final(innen=0,distances=(5,10,15,25,45),field_name ='M00',start=-50*10** ...@@ -427,7 +430,7 @@ def tlm_final(innen=0,distances=(5,10,15,25,45),field_name ='M00',start=-50*10**
if innen==0: if innen==0:
#specify path and file_name #specify path and file_name
file_name = field_name+"_TLM_"+str(j+1)+".csv" file_name = field_name+"_TLM_"+str(j+1)+".csv"
location =r"\\fileserver.cst.rwth-aachen.de\public\Datentransfer\Asonitis, Alexandros" location =r"\\FILESERVER\public\Datentransfer\Asonitis, Alexandros\results"
path= os.path.join(location,file_name) path= os.path.join(location,file_name)
#check if file name exists #check if file name exists
...@@ -439,7 +442,7 @@ def tlm_final(innen=0,distances=(5,10,15,25,45),field_name ='M00',start=-50*10** ...@@ -439,7 +442,7 @@ def tlm_final(innen=0,distances=(5,10,15,25,45),field_name ='M00',start=-50*10**
else: else:
#specify path and file_name #specify path and file_name
file_name = field_name+"_CTLM_"+str(j+1)+".csv" file_name = field_name+"_CTLM_"+str(j+1)+".csv"
location =r"\\fileserver.cst.rwth-aachen.de\public\Datentransfer\Asonitis, Alexandros" location =r"\\FILESERVER\public\Datentransfer\Asonitis, Alexandros\results"
path= os.path.join(location,file_name) path= os.path.join(location,file_name)
#check if file name exists #check if file name exists
......
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,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,
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment