forked from M-Labs/artiq
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
|
||||
|
||||
from ctypes import byref
|
||||
from ctypes import byref, c_ulong
|
||||
import numpy as np
|
||||
|
||||
|
||||
@ -11,6 +11,9 @@ class DAQmxSim:
|
||||
def close(self):
|
||||
pass
|
||||
|
||||
def ping(self):
|
||||
return True
|
||||
|
||||
|
||||
class DAQmx:
|
||||
"""NI PXI6733 DAQ interface."""
|
||||
@ -28,6 +31,14 @@ class DAQmx:
|
||||
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.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user