From 7dfd11e2f0c47b0b2b7303c4c76ee6ffa7e9d39e Mon Sep 17 00:00:00 2001 From: Yann Sionneau Date: Sat, 5 Sep 2015 00:07:58 +0200 Subject: [PATCH] pxi6733: try to fix ping method --- artiq/devices/pxi6733/driver.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/artiq/devices/pxi6733/driver.py b/artiq/devices/pxi6733/driver.py index 153098b5d..6c50c5927 100644 --- a/artiq/devices/pxi6733/driver.py +++ b/artiq/devices/pxi6733/driver.py @@ -1,6 +1,6 @@ # Yann Sionneau , 2015 -from ctypes import byref, c_ulong +from ctypes import byref, c_ulong, create_string_buffer import logging import numpy as np @@ -50,11 +50,13 @@ class DAQmx: def ping(self): try: - data = (c_ulong*1)() - self.daq.DAQmxGetDevSerialNum(self.device, data) + data_len = 128 + data = create_string_buffer(data_len) + self.daq.DAQmxGetSysDevNames(data, data_len) + print("data == {}".format(data.value)) except: return False - return True + return data.value != "" def load_sample_values(self, sampling_freq, values): """Load sample values into PXI 6733 device.