mirror of https://github.com/m-labs/artiq.git
pxi6733: add ping method to the driver
This commit is contained in:
parent
f30d671359
commit
36cda96df0
|
@ -1,6 +1,6 @@
|
||||||
# Yann Sionneau <ys@m-labs.hk>, 2015
|
# Yann Sionneau <ys@m-labs.hk>, 2015
|
||||||
|
|
||||||
from ctypes import byref
|
from ctypes import byref, c_ulong
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,6 +11,9 @@ class DAQmxSim:
|
||||||
def close(self):
|
def close(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def ping(self):
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
class DAQmx:
|
class DAQmx:
|
||||||
"""NI PXI6733 DAQ interface."""
|
"""NI PXI6733 DAQ interface."""
|
||||||
|
@ -28,6 +31,14 @@ class DAQmx:
|
||||||
self.daq.DAQmxClearTask(taskhandle)
|
self.daq.DAQmxClearTask(taskhandle)
|
||||||
self.tasks.remove(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):
|
def load_sample_values(self, values):
|
||||||
"""Load sample values into PXI 6733 device.
|
"""Load sample values into PXI 6733 device.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue