2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-25 03:08:27 +08:00

pxi6733: add ping method to the driver

This commit is contained in:
Yann Sionneau 2015-05-25 21:36:14 +02:00
parent f30d671359
commit 36cda96df0

View File

@ -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.