Skip to content

Commit 7dfd11e

Browse files
committedSep 4, 2015
pxi6733: try to fix ping method
1 parent 6e5b71a commit 7dfd11e

File tree

1 file changed

+6
-4
lines changed
  • artiq/devices/pxi6733

1 file changed

+6
-4
lines changed
 

Diff for: ‎artiq/devices/pxi6733/driver.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Yann Sionneau <ys@m-labs.hk>, 2015
22

3-
from ctypes import byref, c_ulong
3+
from ctypes import byref, c_ulong, create_string_buffer
44
import logging
55

66
import numpy as np
@@ -50,11 +50,13 @@ def _done_callback(self, taskhandle, status, callback_data):
5050

5151
def ping(self):
5252
try:
53-
data = (c_ulong*1)()
54-
self.daq.DAQmxGetDevSerialNum(self.device, data)
53+
data_len = 128
54+
data = create_string_buffer(data_len)
55+
self.daq.DAQmxGetSysDevNames(data, data_len)
56+
print("data == {}".format(data.value))
Has conversations. Original line has conversations.
5557
except:
5658
return False
57-
return True
59+
return data.value != ""
5860

5961
def load_sample_values(self, sampling_freq, values):
6062
"""Load sample values into PXI 6733 device.

0 commit comments

Comments
 (0)
Please sign in to comment.