Skip to content

Commit 36cda96

Browse files
committedMay 25, 2015
pxi6733: add ping method to the driver
1 parent f30d671 commit 36cda96

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed
 

‎artiq/devices/pxi6733/driver.py

+12-1
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
3+
from ctypes import byref, c_ulong
44
import numpy as np
55

66

@@ -11,6 +11,9 @@ def load_sample_values(self, values):
1111
def close(self):
1212
pass
1313

14+
def ping(self):
15+
return True
16+
1417

1518
class DAQmx:
1619
"""NI PXI6733 DAQ interface."""
@@ -28,6 +31,14 @@ def done_callback_py(self, taskhandle, status, callback_data):
2831
self.daq.DAQmxClearTask(taskhandle)
2932
self.tasks.remove(taskhandle)
3033

34+
def ping(self):
35+
try:
36+
data = (c_ulong*1)()
37+
self.daq.DAQmxGetDevSerialNum(self.device, data)
38+
except:
39+
return False
40+
return True
41+
3142
def load_sample_values(self, values):
3243
"""Load sample values into PXI 6733 device.
3344

0 commit comments

Comments
 (0)
Please sign in to comment.