From 36cda96df07f5a358069283d2f35346ba125a5f0 Mon Sep 17 00:00:00 2001 From: Yann Sionneau Date: Mon, 25 May 2015 21:36:14 +0200 Subject: [PATCH] pxi6733: add ping method to the driver --- artiq/devices/pxi6733/driver.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/artiq/devices/pxi6733/driver.py b/artiq/devices/pxi6733/driver.py index 118169ec2..f4ffd4f52 100644 --- a/artiq/devices/pxi6733/driver.py +++ b/artiq/devices/pxi6733/driver.py @@ -1,6 +1,6 @@ # Yann Sionneau , 2015 -from ctypes import byref +from ctypes import byref, c_ulong import numpy as np @@ -11,6 +11,9 @@ class DAQmxSim: def close(self): pass + def ping(self): + return True + class DAQmx: """NI PXI6733 DAQ interface.""" @@ -28,6 +31,14 @@ class DAQmx: self.daq.DAQmxClearTask(taskhandle) self.tasks.remove(taskhandle) + def ping(self): + try: + data = (c_ulong*1)() + self.daq.DAQmxGetDevSerialNum(self.device, data) + except: + return False + return True + def load_sample_values(self, values): """Load sample values into PXI 6733 device.