Skip to content

Commit

Permalink
Fixed an issue where the picoammeter doesnt always send three words c…
Browse files Browse the repository at this point in the history
…ausing an index crash, adjusted the way we tell kst201 to stop such that it doesnt hang forever.
  • Loading branch information
mitbailey committed Jun 10, 2024
1 parent 39d1bb2 commit dc410ac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions drivers/ki_picoammeter.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,18 +158,18 @@ def detect(self):
return out
out = buf
spbuf = buf.split(',')
try:
if int(float(spbuf[2])) != 2:
log.error("ERROR #%d"%(int(float(spbuf[2]))))
except Exception:
log.error('Error: %s invalid output'%(buf))
# try:
# if int(float(spbuf[2])) != 2:
# log.error("ERROR #%d"%(int(float(spbuf[2]))))
# except Exception:
# log.error('Error: %s invalid output'%(buf))

words = buf.split(',')
if len(words) != 3:
log.error('Error: detector output', buf)

mes = float(words[0][:-1]) # skips the A (unit suffix)
err = int(float(words[2])) # skip timestamp
# err = int(float(words[2])) # skip timestamp

mes *= 1e12 # Converts from A to pA

Expand Down
3 changes: 2 additions & 1 deletion drivers/tl_kst101.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ def get_position(self):

@wrap_result()
def stop(self):
self._dev.Stop(10000)
self._dev.Stop(0)
time.sleep(5)
self.home() # KST201 requires a homing after a stop

@wrap_result()
Expand Down

0 comments on commit dc410ac

Please sign in to comment.