-
Notifications
You must be signed in to change notification settings - Fork 56
Open
Description
Hi,
Since I'm new to PyDAQmx, I'd really appreciate your help. I'm trying to do synchronous input and output using a NI USB-6212 (BNC) device, but I have several questions:
-
Can a task support both input and output? As far as I understand, it cannot, so I have to create two separate tasks, right?
-
I tried to write a script using the simple functions DAQmxWriteAnalogF64 and DAQmxReadAnalogF64. What I wanted to do is read back the sine wave I wrote to the output channel. After reading instructions in the NI site, I used the following functions and parameters to control the timing of the two tasks:
daq.DAQmxCfgSampClkTiming(taskHandle_output,"",fs,daq.DAQmx_Val_Falling,daq.DAQmx_Val_ContSamps,block)
daq.DAQmxCfgSampClkTiming(taskHandle_input,"ao/SampleClock",fs,daq.DAQmx_Val_Falling,daq.DAQmx_Val_ContSamps,block)
with block = 1024. However, there was a noticeable latency between the two tasks.
- I am wondering if I have to use callback functions (and maybe threading??) to achieve this simultaneity of input and output. But again, it's not straightforward to me how to do that. Would I have to write two different callback functions, one for the output and one for the input task?
Thanks in advance for any advice!
Metadata
Metadata
Assignees
Labels
No labels