From b672a99174493460f3eaa05d48a95b343692d0f0 Mon Sep 17 00:00:00 2001 From: Yann Sionneau Date: Thu, 26 Feb 2015 12:53:54 +0100 Subject: [PATCH] lda: add support for ping --- artiq/devices/lda/driver.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/artiq/devices/lda/driver.py b/artiq/devices/lda/driver.py index 70c199c20..fdc8763a3 100644 --- a/artiq/devices/lda/driver.py +++ b/artiq/devices/lda/driver.py @@ -63,6 +63,9 @@ class Ldasim: print("setting attenuation to {}".format(att)) self._attenuation = att + def ping(self): + return True + class Lda: """Lab Brick Digital Attenuator driver. @@ -230,3 +233,10 @@ class Lda: raise ValueError("Cannot set attenuation {} < 0".format(att)) else: self.set(0x8d, bytes([int(round(att.amount*4))])) + + def ping(self): + try: + self.get_attenuation() + except: + return False + return True