From 090d299c8a2d18a4606c338c21f5f29af15d56cb Mon Sep 17 00:00:00 2001 From: gac-x03da Date: Thu, 8 Feb 2018 17:18:31 +0100 Subject: [PATCH] Closedown --- script/keithley.py | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/script/keithley.py b/script/keithley.py index 53d397ee..8ad4350f 100644 --- a/script/keithley.py +++ b/script/keithley.py @@ -32,8 +32,8 @@ class Keithley(object): dwell = dwell time in seconds (0.1 - 20.0) """ - self.scanCh.putq(0) - self.ttypeCh.putq(2) + self.scanCh.write(0) + self.ttypeCh.write(2) nplc = 5. navg = dwell / 0.1 if navg > 100: @@ -41,25 +41,22 @@ class Keithley(object): navg /= 2 navg = min(navg, 100) nplc = min(nplc, 10.) - self.nplcCh.putq(nplc) - self.navgCh.putq(navg) + self.nplcCh.write(nplc) + self.navgCh.write(navg) def trig(self): """ trigger keithleys, wait until done, and read the result into EPICS. the value can then be read by pshell from the channel. """ - dwell1 = caget(KEI_SAMPLE + "TOTTIME") / 1000. - dwell2 = caget(KEI_REF + "TOTTIME") / 1000. - dwell = max(dwell1, dwell2) - self.doinitCh.put(1) - self.dotriggerCh.put(1) + self.doinitCh.write(1) + self.dotriggerCh.write(1) def get_dwell(self): """ get dwell time in seconds. """ - dwell = self.tottimeCh.get() / 1000. + dwell = self.tottimeCh.read() / 1000. return dwell def fetch(self): @@ -67,23 +64,23 @@ class Keithley(object): fetch the current value from the keithley into EPICS. """ #time.sleep(self.get_dwell()) - self.dofetchCh.put(1) + self.dofetchCh.write(1) def read(self): """ read the curent value. """ - return self.readoutCh.get() + return self.readoutCh.read() def release(self): """ switch keithleys to free run. 0.1 s polling and dwell time """ - self.nplcCh.putq(nplc) - self.navgCh.putq(navg) - self.scanCh.putq(9) - self.ttypeCh.putq(0) + self.nplcCh.write(nplc) + self.navgCh.write(navg) + self.scanCh.write(9) + self.ttypeCh.write(0) KeiSample = Keithley("SampleKeithley", "X03DA-KEITHLEY-1:") KeiReference = Keithley("ReferenceKeithley", "X03DA-KEITHLEY-2:")