From 486add7a4a41749a5db1056fa975c2f45ca1a164 Mon Sep 17 00:00:00 2001 From: x07maop Date: Tue, 1 Mar 2016 10:22:13 +0100 Subject: [PATCH] Script execution --- script/local.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/script/local.py b/script/local.py index 2e04c27..089d3aa 100644 --- a/script/local.py +++ b/script/local.py @@ -144,9 +144,9 @@ controller.addListener(Listener()) #Old listeners are cleande in startup #TODO: Should set devices? K10, k11, k24 seem not to be defined.... keithleys = { #name:[Setpoint, range, Readback] #TODO - "k1": [None , 'X07MA-PC-K428:1:setGain', None], - "k2": [None , 'X07MA-PC-K428:2:setGain', None], - "k3": [None , 'X07MA-PC-K428:3:setGain', None], + "k1": [None , 'X07MA-PC-K428:1:setGain', 'X07MA-PC-K428:1:getGain'], + "k2": [None , 'X07MA-PC-K428:2:setGain', 'X07MA-PC-K428:2:getGain'], + "k3": [None , 'X07MA-PC-K428:3:setGain', 'X07MA-PC-K428:3:getGain'], "k10":['X07MA-KEI10:SETVOLTAGE' , 'X07MA-KEI10:RANGE', None], "k11":['X07MA-KEI11:SETVOLTAGE' , 'X07MA-KEI11:RANGE', None], "k24":['X07MA-KEI2400:setVoltAO', None, None] @@ -223,7 +223,12 @@ def set_volt(keithley, value, delay=0.1): #value is int from 1 to 10 def set_range(keithley, value): if not keithley in keithleys.keys(): raise Exception("Invalid keithley: " + keithley) - caput(keithleys[keithley][1], '10^'+str(value)) + v='10^'+str(value) + while True: + caput(keithleys[keithley][1], v) + time.sleep(1.0) + if caget(keithleys[keithley][1],'s') == v: + break #only test .5 to .25 def set_fe(opening):