Skip to content

Commit

Permalink
pxi6733: add ping method to the driver
Browse files Browse the repository at this point in the history
fallen committed May 25, 2015
1 parent f30d671 commit 36cda96
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion artiq/devices/pxi6733/driver.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Yann Sionneau <ys@m-labs.hk>, 2015

from ctypes import byref
from ctypes import byref, c_ulong
import numpy as np


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

def ping(self):
return True


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

def ping(self):
try:
data = (c_ulong*1)()
self.daq.DAQmxGetDevSerialNum(self.device, data)
except:
return False
return True

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

0 comments on commit 36cda96

Please sign in to comment.