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
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.