forked from M-Labs/artiq
1
0
Fork 0

pxi6733: try to fix ping method

This commit is contained in:
Yann Sionneau 2015-09-05 00:07:58 +02:00
parent 6e5b71a43e
commit 7dfd11e2f0
1 changed files with 6 additions and 4 deletions

View File

@ -1,6 +1,6 @@
# Yann Sionneau <ys@m-labs.hk>, 2015 # Yann Sionneau <ys@m-labs.hk>, 2015
from ctypes import byref, c_ulong from ctypes import byref, c_ulong, create_string_buffer
import logging import logging
import numpy as np import numpy as np
@ -50,11 +50,13 @@ class DAQmx:
def ping(self): def ping(self):
try: try:
data = (c_ulong*1)() data_len = 128
self.daq.DAQmxGetDevSerialNum(self.device, data) data = create_string_buffer(data_len)
self.daq.DAQmxGetSysDevNames(data, data_len)
print("data == {}".format(data.value))
except: except:
return False return False
return True return data.value != ""
def load_sample_values(self, sampling_freq, values): def load_sample_values(self, sampling_freq, values):
"""Load sample values into PXI 6733 device. """Load sample values into PXI 6733 device.