I am trying to write a program in PyDAQmx that counts digital edges and outputs a TTL signal every nth edge. I am having trouble setting the Acquisition Mode in PyDAQmx to be "1 Sample (On Demand)" which is what I set while using LabVIEW. I am using a NI USB6210 DAQ Device.
This is my first time coding with NIDAQ/PyDAQMX/etc so I based this on an example on the PyDAQmx page that shows how to translate a C program into Python, the relevant piece of code looks like this:
read = int32()
data = numpy.zeros((1000,), dtype=numpy.uint32)
try:
DAQmxCreateTask("",byref(taskHandle))
DAQmxCreateCICountEdgesChan(taskHandle,"Dev6/ctr0","",DAQmx_Val_Rising,0,DAQmx_Val_CountUp)
#Somehow set acquisition mode here
DAQmxStartTask(taskHandle)
while True:
DAQmxReadCounterScalarU32 (taskHandle, 1000, None, read)
print "Acquired %d samples"%read.value
print "result is %s " %result