From 1a218126898cc6c92e22989b8ff30c79f528ef76 Mon Sep 17 00:00:00 2001 From: sas011752342 Date: Sun, 26 Feb 2017 09:14:06 +0200 Subject: [PATCH 1/8] changed the addresses to fit my computer --- .gitignore | 4 +++- init.py | 18 +++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 8ae14a8..e2339eb 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -Tests/DCX81/dcx81_spi_test_with_dbmd6.py \ No newline at end of file +Tests/DCX81/dcx81_spi_test_with_dbmd6.py +*.txt +*.xlsx \ No newline at end of file diff --git a/init.py b/init.py index ce28c93..4682763 100644 --- a/init.py +++ b/init.py @@ -11,9 +11,9 @@ ####################################################################################### ### home-made modules: ###################### -execfile(r"C:\Users\bar.kristal\Documents\GitHub\Python\devices.py") -execfile(r"C:\Users\bar.kristal\Documents\GitHub\Python\utilities.py") -execfile(r"C:\Users\bar.kristal\Documents\GitHub\Python\lab_equipment.py") +execfile(r"C:\GitHub\Python\devices.py") +execfile(r"C:\GitHub\Python\utilities.py") +execfile(r"C:\GitHub\Python\lab_equipment.py") ####################################################################################### @@ -71,18 +71,18 @@ ##### defines: ############# -T32_APP_CMM_PATH = r"T:\\Barkristal\DVF101\SPI\scripts\dvf101_app.cmm" -POWER_SUPPLY_FOR_RESET = ["GPIB0::29::INSTR", 2] #(addres, channel) +T32_APP_CMM_PATH = r"C:\T32\DVF101\script_from_lautherbach_support.cmm" + #lab_equipment GPIB addresses: -POWER_SUPLLY_ADDRESS = "GPIB0::29::INSTR" -DMM_ADDRESS = "GPIB0::22::INSTR" +POWER_SUPLLY_ADDRESS = "GPIB0::2::INSTR" +DMM_ADDRESS = "GPIB1::22::INSTR" FREQUENCY_COUNTER_ADDRESS = "GPIB0::27::INSTR" WAVE_GENERATOR_ADDRESS = "GPIB0::1::INSTR" ELECTRONIC_LOAD = "GPIB0::3::INSTR" #TCP_IP addresses: -#TERMOTRON_TCP_IP = ("172.19.5.237" ,8080) # (ip, port) , (Sas) -TERMOTRON_TCP_IP = ("172.19.5.240" ,8080) # (ip, port) , (Ronny) +TERMOTRON_TCP_IP = ("172.19.5.237", 8080) # (ip, port) , (Sas) +#TERMOTRON_TCP_IP = ("172.19.5.240", 8080) # (ip, port) , (Ronny) ############################################################################################# From c40d3e3c1c6af2a85b1583830f52b095ac703f34 Mon Sep 17 00:00:00 2001 From: sas011752342 Date: Sun, 26 Feb 2017 09:23:00 +0200 Subject: [PATCH 2/8] corrections in test.py --- test1.py | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/test1.py b/test1.py index 1cd9ab3..f9a2ca4 100644 --- a/test1.py +++ b/test1.py @@ -4,6 +4,8 @@ FOLDER_PATH = r"C:\\Users\bar.kristal\Documents\GitHub\Python\Tests\functionality_test" FOLDER_NAME = "Log" TEST_NAME = "test1" + +T32_APP_CMM_PATH = r"T:\\barkristal\DVF101\SPI\scripts\dvf101_app.cmm" ################################################################# execfile(r"C:\Users\bar.kristal\Documents\GitHub\Python\init.py") @@ -37,7 +39,7 @@ ######################## ## Excel: -# wb1, full_path = create_excel_file(Dir_Name, Excel_Log_Name") +# wb1, full_path = create_excel_file(DIR_NAME, LOG_NAME_EXCEL) # ws1 = wb1.create_sheet("new sheet is the new shit!") # ws1.cell(row=1,column=1).value="write something" # wb1.save(full_path) @@ -48,12 +50,14 @@ ######################## ## Power Supply: -# pwr_sply = QL355TPPwrSply('GPIB0::29::INSTR',RESOURCE_MANAGER) +# pwr_sply = QL355TPPwrSply(POWER_SUPLLY_ADDRESS, RESOURCE_MANAGER) # print pwr_sply.name -# pwr_sply.set_volt(1,5) +# pwr_sply.channel_on('1') +# pwr_sply.set_volt(1,4.3) # pwr_sply.read_current(1) # pwr_sply.sense(2,1) -# pwr_sply.channel_on('1') +# +# pwr_sply.set_current_lim(1,1.32) # pwr_sply.close() ######################## @@ -95,10 +99,10 @@ ######################## ## Blue oven: -# termotron = Termotron3800(TERMOTRON_TCP_IP) -# termotron.stop_chamber() -# termotron.set_temp(23) -# termotron.wait_for_temp(29) -# print termotron.read_temp() -# time.sleep(3) -# termotron.stop_chamber() \ No newline at end of file +termotron = Termotron3800(TERMOTRON_TCP_IP) +termotron.stop_chamber() +termotron.set_temp(23) +termotron.wait_for_temp(29) +print termotron.read_temp() +time.sleep(3) +termotron.stop_chamber() \ No newline at end of file From 86b9a32898910f90af4e1e9afc6dbe252d2e8495 Mon Sep 17 00:00:00 2001 From: sas011752342 Date: Sun, 26 Feb 2017 09:46:16 +0200 Subject: [PATCH 3/8] addresses --- test1.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/test1.py b/test1.py index f9a2ca4..a935fc6 100644 --- a/test1.py +++ b/test1.py @@ -1,14 +1,13 @@ ################################################################ ## Test ID: -FOLDER_PATH = r"C:\\Users\bar.kristal\Documents\GitHub\Python\Tests\functionality_test" +FOLDER_PATH = r"C:\GitHub\Python\functionality_test" FOLDER_NAME = "Log" TEST_NAME = "test1" -T32_APP_CMM_PATH = r"T:\\barkristal\DVF101\SPI\scripts\dvf101_app.cmm" ################################################################# -execfile(r"C:\Users\bar.kristal\Documents\GitHub\Python\init.py") +execfile(r"C:\GitHub\Python\init.py") @@ -99,10 +98,10 @@ ######################## ## Blue oven: -termotron = Termotron3800(TERMOTRON_TCP_IP) -termotron.stop_chamber() -termotron.set_temp(23) -termotron.wait_for_temp(29) -print termotron.read_temp() -time.sleep(3) -termotron.stop_chamber() \ No newline at end of file +# termotron = Termotron3800(TERMOTRON_TCP_IP) +# termotron.stop_chamber() +# termotron.set_temp(23) +# termotron.wait_for_temp(29) +# print termotron.read_temp() +# time.sleep(3) +# termotron.stop_chamber() \ No newline at end of file From b26b4024e64e562c8fcbb292d8b7dd91988882bd Mon Sep 17 00:00:00 2001 From: sas011752342 Date: Sun, 26 Feb 2017 09:47:52 +0200 Subject: [PATCH 4/8] addded Bisset's termotron --- init.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/init.py b/init.py index 4682763..598fd53 100644 --- a/init.py +++ b/init.py @@ -82,7 +82,8 @@ ELECTRONIC_LOAD = "GPIB0::3::INSTR" #TCP_IP addresses: -TERMOTRON_TCP_IP = ("172.19.5.237", 8080) # (ip, port) , (Sas) -#TERMOTRON_TCP_IP = ("172.19.5.240", 8080) # (ip, port) , (Ronny) +#TERMOTRON_TCP_IP = ("172.19.5.237", 8080) # (ip, port) , (Sas) +#TERMOTRON_TCP_IP = ("172.19.5.239", 8080) # (ip, port) , (Bisset) +TERMOTRON_TCP_IP = ("172.19.5.240", 8080) # (ip, port) , (Ronny) ############################################################################################# From 0a2ef6f39ed99f3df55eb48bffe3fe460acff052 Mon Sep 17 00:00:00 2001 From: sas011752342 Date: Thu, 2 Mar 2017 07:58:41 +0200 Subject: [PATCH 5/8] new tests --- DVF101 MIPS Test.py | 12 +++++++ DVF101_MIPS.py | 76 +++++++++++++++++++++++++++++++++++++++++++++ dmm_test.py | 53 +++++++++++++++++++++++++++++++ 3 files changed, 141 insertions(+) create mode 100644 DVF101 MIPS Test.py create mode 100644 DVF101_MIPS.py create mode 100644 dmm_test.py diff --git a/DVF101 MIPS Test.py b/DVF101 MIPS Test.py new file mode 100644 index 0000000..921c861 --- /dev/null +++ b/DVF101 MIPS Test.py @@ -0,0 +1,12 @@ +################################################################ +## Test ID: +FOLDER_PATH = r"C:\GitHub\Python\functionality_test" +FOLDER_NAME = "Log" +TEST_NAME = "dmm_test" + +################################################################# + +execfile(r"C:\GitHub\Python\init.py") + + +######################## \ No newline at end of file diff --git a/DVF101_MIPS.py b/DVF101_MIPS.py new file mode 100644 index 0000000..5f4b798 --- /dev/null +++ b/DVF101_MIPS.py @@ -0,0 +1,76 @@ +################################################################ +## Test ID: +FOLDER_PATH = r"C:\GitHub\Python\DVF101" +FOLDER_NAME = "Log" +TEST_NAME = "DVF101_MIPS_test" + +################################################################# + +execfile(r"C:\GitHub\Python\init.py") + + +######################## +DMM = Agillent34401A(DMM_ADDRESS, RESOURCE_MANAGER) #init DMM +dvf101 = Lauterbach("DVF101") #from test1.py +address = '5301000' + + + +cmm_path = r"G:\Chip_Validation\sasone\DVF101\MIPS\DVF101_PLL1_Configuration.cmm" #changing frequency and measure the current on VDD_1V1 +dvf101.execute_cmm_file(cmm_path) + +configuration_list = ['b03c083', '903c083', + '1200c083', '1100c083', + '1000c083', 'f00c083', + 'e00c083', 'd00c083', + 'c00c083', 'b00c083', + 'a00c083', '900c083', + '800c083', '700c083', + '600c083', '500c083', + '400c083', '300c083', + '200c083', '100c083', + 'C083'] + + +wb1, excel_full_path = create_excel_file(DIR_NAME, LOG_NAME_EXCEL) +ws1 = wb1.create_sheet("DVF101") +row_idx = 3 + +for config in configuration_list: + dvf101.write_register(address, config) + time.sleep(0.5) + dmm_value = DMM.meas("DCV") + ws1.cell(row=row_idx, column=3).value = dmm_value + row_idx = row_idx+1 + +ws1.cell(row=2,column=3).value="DVF101_MIPS_test" +wb1.save(excel_full_path) + +## Excel: + + +# wb1, full_path = create_excel_file(DIR_NAME, LOG_NAME_EXCEL) +# ws1 = wb1.create_sheet("new sheet is the new shit!") +# ws1.cell(row=3,column=3).value="write something" +# wb1.save(full_path) +# wb = open_excel_file(full_path) +# print wb.get_sheet_names() + + ## Lauterbach: + + # DVF101 = Lauterbach("DVF101") + # DVF101.write_register("5300000", "5555") + # DVF101.set_bits("5300000", "410", "40") + # print DVF101.read_register("5300000") + # DVF101.execute_cmm_file(br"T:\barkristal\DVF101\SPI\clkout.cmm") + # DVF101.close() + +######################## +## Excel: + +# wb1, full_path = create_excel_file(DIR_NAME, LOG_NAME_EXCEL) +# ws1 = wb1.create_sheet("new sheet is the new shit!") +# ws1.cell(row=1,column=1).value="write something" +# wb1.save(full_path) +# wb=open_excel_file(full_path) +# print wb.get_sheet_names() diff --git a/dmm_test.py b/dmm_test.py new file mode 100644 index 0000000..6238eda --- /dev/null +++ b/dmm_test.py @@ -0,0 +1,53 @@ +################################################################ +## Test ID: +FOLDER_PATH = r"C:\GitHub\Python\functionality_test" +FOLDER_NAME = "Log" +TEST_NAME = "dmm_test" + +################################################################# + +execfile(r"C:\GitHub\Python\init.py") + + +######################## +## Power Supply: + +# pwr_sply = QL355TPPwrSply(POWER_SUPLLY_ADDRESS, RESOURCE_MANAGER) #init power supply +# DMM = Agillent34401A(DMM_ADDRESS, RESOURCE_MANAGER) #init DMM +# print pwr_sply.name +# pwr_sply.channel_on('1') +# volt_list=[0.5, 1, 2, 3.5] +# for voltage in volt_list: +# pwr_sply.set_volt(1,voltage) +# time.sleep(0.5) +# DMM.meas("DCV") +# print pwr_sply.read_current(1) +# print voltage + + + + + + + + + +# print pwr_sply.name +# pwr_sply.channel_on('1') +# volt_list=[0.5, 1, 2, 1.5] +# for voltage in volt_list: +# pwr_sply.set_volt(1,voltage) +# time.sleep(0.1) +# print pwr_sply.read_current(1) +# pwr_sply.sense(1,1) +# pwr_sply.set_current_lim(1,1.32) +# pwr_sply.close() + + +##HEWLETT PACKARD 34401A + + +# print DMM.name +# DMM.meas("DCV") +# a= dmm_multimeter.meas("volt_min_peak") +# dmm_multimeter.meas("phase") \ No newline at end of file From 0d0ebc1a5aa1dc4a44152f569f2274b471d35b0d Mon Sep 17 00:00:00 2001 From: sas011752342 Date: Thu, 2 Mar 2017 08:00:01 +0200 Subject: [PATCH 6/8] gpib address updated --- init.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.py b/init.py index 598fd53..bb68c25 100644 --- a/init.py +++ b/init.py @@ -75,7 +75,7 @@ #lab_equipment GPIB addresses: -POWER_SUPLLY_ADDRESS = "GPIB0::2::INSTR" +POWER_SUPLLY_ADDRESS = "GPIB1::4::INSTR" DMM_ADDRESS = "GPIB1::22::INSTR" FREQUENCY_COUNTER_ADDRESS = "GPIB0::27::INSTR" WAVE_GENERATOR_ADDRESS = "GPIB0::1::INSTR" From c01b4c34e85cc03e50b23431e1776d032219123d Mon Sep 17 00:00:00 2001 From: valab Date: Thu, 2 Mar 2017 09:40:30 +0200 Subject: [PATCH 7/8] no need to send RESOURCE_MANAGER --- .gitignore | 6 +++ lab_equipment.py | 97 +++++++++++++++++++++++++++++++----------------- test1.py | 31 ++++++++++++---- 3 files changed, 92 insertions(+), 42 deletions(-) diff --git a/.gitignore b/.gitignore index e2339eb..5a8db5d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,9 @@ Tests/DCX81/dcx81_spi_test_with_dbmd6.py *.txt +<<<<<<< HEAD +======= +*.bak +Tests/DCX81/spi_read_fifo.cmm +Tests/DCX81/spi2_slave.cmm +>>>>>>> refs/remotes/origin/master *.xlsx \ No newline at end of file diff --git a/lab_equipment.py b/lab_equipment.py index d41bc69..d47419d 100644 --- a/lab_equipment.py +++ b/lab_equipment.py @@ -17,14 +17,15 @@ def __init__(self): #Lab equipment classes: class Agillent34401A(): - def __init__(self,address,resource_manager): + def __init__(self,address): + resource_manager = visa.ResourceManager() self.dev=resource_manager.open_resource(address) self.name=self.dev.query('*IDN?')[:-1] self.dev.timeout = 5000 def close(self): self.dev.close() - write_to_log ('The connection with: %s is now closed' %(self.name)) + #write_to_log ('The connection with: %s is now closed' %(self.name)) def send_command(self, command): #Send a visa command to the device. @@ -65,7 +66,8 @@ def meas(self,meas): class QL355TPPwrSply(): - def __init__(self,address,resource_manager): + def __init__(self,address): + resource_manager = visa.ResourceManager() self.dev=resource_manager.open_resource(address) self.dev.clear() self.name=self.dev.query('*IDN?')[:-1] @@ -95,7 +97,7 @@ def set_volt(self, channel, volt): self.dev.write("V%s %s" %(channel , volt)) time.sleep(0.5) res = self.dev.query("V%s?" %(channel))[:-1] - write_to_log (res) + return res def set_current_lim(self, channel, current): #set the current limit of the specified channel @@ -103,7 +105,7 @@ def set_current_lim(self, channel, current): self.dev.write("I%s %s" %(channel ,current)) time.sleep(0.1) res = self.dev.query("I%s?" %(channel))[:-1] - write_to_log(res) + return res def channel_on(self, channel): #set ON the specified channel @@ -122,36 +124,38 @@ def increment_voltage(self, channel, step_size): channel = str(channel) self.dev.write('DELTAV%s %s' %(channel ,step_size)) self.dev.write('INCV%s' %(channel)) - write_to_log("Channel %s was incremented by %sV" %(channel ,step_size)) - self.dev.write('V%s?' %(channel)) - write_to_log("Channel %s volatge is now %sV" %(channel ,self.dev.read()[3:])) - + #write_to_log("Channel %s was incremented by %sV" %(channel ,step_size)) + res = self.dev.write('V%s?' %(channel)) + #write_to_log("Channel %s volatge is now %sV" %(channel ,self.dev.read()[3:])) + return res + def all_off(self): #set ALL channels OFF self.dev.write('OPALL 0') - write_to_log("All channels set OFF") + #write_to_log("All channels set OFF") def all_on(self): #set ALL channels ON self.dev.write('OPALL 1') - write_to_log("All channels set ON") + #write_to_log("All channels set ON") def read_current(self, channel): #reads the current flows right now through the channel self.dev.write('I%sO?' %(str(channel))) cur = self.dev.read()[:-1] - write_to_log("The current at channel %s is: %s" %(channel, cur)) + #write_to_log("The current at channel %s is: %s" %(channel, cur)) return cur def sense(self, channel, mode): #mode=0: local, mode=1: remote self.dev.write('SENSE%s %s' %(channel, mode)) mod="local" if mode == '0' else "remote" - write_to_log("Activated %s sense on channel %s" %(mod, str(channel))) + #write_to_log("Activated %s sense on channel %s" %(mod, str(channel))) class HP53131aFreqCounter(): - def __init__(self,address,resource_manager): + def __init__(self,address): + resource_manager = visa.ResourceManager() self.dev=resource_manager.open_resource(address) self.name=self.dev.query('*IDN?')[:-1] self.dev.timeout = 5000 @@ -225,7 +229,8 @@ def meas(self, meas, channel="1"): class HP33120aWaveGen(): - def __init__(self, address, resource_manager): + def __init__(self, address): + resource_manager = visa.ResourceManager() self.dev=resource_manager.open_resource(address) self.name=self.dev.query('*IDN?')[:-1] self.dev.timeout = 5000 @@ -246,7 +251,7 @@ def read_response(self, command): #Generate a waveform in single command. #Example: self.generate("SIN", 3000, 1.5, -1) generates a sine wave, 3KHz, 1.5Vpp, -1V offset. def generate(self, wave, frequency, amplitude, offset): - self.dev.write("APPL:%s %s, %s, %s" %(wave, freqency, amplitude, offset)) + self.dev.write("APPL:%s %s, %s, %s" %(wave, frequency, amplitude, offset)) #Set specifiied shape : SINusoid|SQUare|TRIangle|RAMP|NOISe|DC|USER def set_shape(self, shape): @@ -295,7 +300,8 @@ def get_offset(self): class KikusuiPLZ70UA(): - def __init__(self, address, resource_manager): + def __init__(self, address): + resource_manager = visa.ResourceManager() self.dev=resource_manager.open_resource(address) self.name=self.dev.query('*IDN?')[:-1] self.dev.timeout = 5000 @@ -459,36 +465,53 @@ def __init__(self,address): self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.sock.connect((self.tcp_ip, self.port)) self.sock.send("IDEN?\r\n") #ask for device identity - self.name = self.sock.recv(23) - self.sock.recv(10) + self.name = self.read_line() self.sock.send("VRSN?\r\n") #ask for software version - self.version = self.sock.recv(16) - self.sock.recv(5) - + self.version = self.read_line() + + #close connection with device def close(self): self.sock.close() - + + #read line from socket + def read_line(self): + line = "" + while True: + c = self.sock.recv(64) + if c == "": + break + elif "\r" in c: + line += c.split("\r")[0] + break + else: + line += c + return line + #before reading the device's answer: def clear_buffer(self): - self.sock.recv(10) + c = self.sock.recv(1) + while (c != ""): + c = self.sock.recv(16) time.sleep(0.1) - + + #stop chamber from working def stop_chamber(self): err = "0" k = 0 - while (err != "5" and k<10): #5 means that Termotron received the stop command + while (err != "5" and k<3): #5 means that Termotron received the stop command self.sock.send("STOP\r\n") #send the STOP command - self.clear_buffer() self.sock.send("SCOD?\r\n") #check if the command had been received - err = self.sock.recv(1) - + err = self.read_line() + k += 1 + if (k == 10): #5 means that Termotron received the stop command write_to_log("Error while sending STOP command to %s" %self.name) def run_chamber(self): self.sock.send("RUNM\r\n") - + + def set_temp(self, temp): if type(temp != str): temp = str(temp) @@ -498,19 +521,23 @@ def set_temp(self, temp): #read the current temperature of the chamber. def read_temp(self): - self.clear_buffer() self.sock.send("PVAR1?\r\n") #read the deviation from the configured value time.sleep(0.1) - current_temp = float(self.sock.recv(4)) - return current_temp + current_temp = self.read_line() + count = 0 + while current_temp == '0' and count<3: + self.sock.send("PVAR1?\r\n") + current_temp = self.read_line() + count += 1 + return float(current_temp) def wait_for_temp(self, temp): self.set_temp(temp) time.sleep(0.1) - current_temp = float(self.read_temp()) + current_temp = self.read_temp() while (abs(current_temp) <= abs(temp*0.98) or abs(current_temp) >= abs(temp*1.02)): time.sleep(1) - current_temp = float(self.read_temp()) + current_temp = self.read_temp() write_to_log("Temperature has reached the desirable value") diff --git a/test1.py b/test1.py index a935fc6..f1dab99 100644 --- a/test1.py +++ b/test1.py @@ -38,9 +38,9 @@ ######################## ## Excel: -# wb1, full_path = create_excel_file(DIR_NAME, LOG_NAME_EXCEL) +# wb1, path = create_excel_file(DIR_NAME, LOG_NAME_EXCEL) # ws1 = wb1.create_sheet("new sheet is the new shit!") -# ws1.cell(row=1,column=1).value="write something" +# ws1.cell(row=1,column=1).value="write something" # wb1.save(full_path) # wb=open_excel_file(full_path) # print wb.get_sheet_names() @@ -49,7 +49,7 @@ ######################## ## Power Supply: -# pwr_sply = QL355TPPwrSply(POWER_SUPLLY_ADDRESS, RESOURCE_MANAGER) +# pwr_sply = QL355TPPwrSply(POWER_SUPLLY_ADDRESS) # print pwr_sply.name # pwr_sply.channel_on('1') # pwr_sply.set_volt(1,4.3) @@ -62,7 +62,7 @@ ######################## ## Frequency counter: -# freq_counter = HP53131aFreqCounter(FREQUENCY_COUNTER_ADDRESS, RESOURCE_MANAGER) +# freq_counter = HP53131aFreqCounter(FREQUENCY_COUNTER_ADDRESS) # print freq_counter.name # freq_counter.meas("freqency") # a= freq_counter.meas("volt_min_peak") @@ -72,7 +72,7 @@ ######################## ## Electronc load: -# load = KikusuiPLZ70UA(ELECTRONIC_LOAD, RESOURCE_MANAGER) +# load = KikusuiPLZ70UA(ELECTRONIC_LOAD_ADDRESS) # print load.name # load.reset() # load.load_on() @@ -94,14 +94,31 @@ # fridg.close() - ######################## ## Blue oven: # termotron = Termotron3800(TERMOTRON_TCP_IP) # termotron.stop_chamber() # termotron.set_temp(23) +<<<<<<< HEAD # termotron.wait_for_temp(29) # print termotron.read_temp() # time.sleep(3) -# termotron.stop_chamber() \ No newline at end of file +# termotron.stop_chamber() +======= +# termotron.wait_for_temp(22) +# write_to_log(termotron.read_temp()) +# time.sleep(1) +# termotron.stop_chamber() + + +######################## +## DMM + +# dmm = Agillent34401A(DMM_ADDRESS) +# dmm.meas("DCV") +# dmm.meas("ACV") +# dmm.meas("frequency") +# dmm.close() + +>>>>>>> refs/remotes/origin/master From 7f583aa95d0f7991c86b7c85aa56bb8c12a00b38 Mon Sep 17 00:00:00 2001 From: valab Date: Thu, 2 Mar 2017 09:40:51 +0200 Subject: [PATCH 8/8] Lauterbach bug fixed --- devices.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/devices.py b/devices.py index 53bbf59..5547e9c 100644 --- a/devices.py +++ b/devices.py @@ -276,14 +276,15 @@ def __init__(self, name): rc2 = self.t32api.T32_Attach(T32_DEV) rc3 = self.t32api.T32_Ping() if (rc2 != T32_OK or rc3 != T32_OK): - write_to_log("Error while connecting to debug interface, attampt number {}".format(count)) exception_2_raised=1 self.close() + if count == num_of_attempts: + write_to_log("Error- failed to connect to Lautebach after {} attempts".format(count+1)) # Start PRACTICE script - run dvf101_app.cmm self.t32api.T32_Cmd(b"CD.DO {}".format(T32_APP_CMM_PATH)) time.sleep(2) - - + + def close(self): self.t32api.T32_Exit() @@ -310,7 +311,7 @@ def set_bits(self, address, bits_to_set, value_to_set, length="LONG"): if (self.t32api.T32_Cmd(command) != T32_OK): write_to_log("error while writing to 0x{}".format(address)) - + #set to 0 only the specified bits def clear_bits(self, address, bits_to_clear, length="LONG"): command = "PER.Set.Field A:{} %{} 0x{} {}".format(address, length ,str(bits_to_set), '0')