Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

reduce delay between AI and AO

hi,
   How to reduce the delay between AI and AO in the program attached as follow.
   Thanks!
0 Kudos
Message 1 of 2
(2,614 Views)
Hello.  One thought would be to read fewer samples per iteration.  It looks like you are reading about 2000 samples every time the DAQmx Read executes.  At 20kSamples/sec, this alone will take a tenth of a second.  Reading fewer samples will allow the DAQmx Read to return faster, allowing the DAQmx Write to execute quicker.  That will give you a faster response, by allowing your loop to run faster.  I also noticed you have a 50 ms wait in your loop.  Depending on how many samples you choose to read, that might be a limiting factor as well.  Something to note, you aren't really doing any heavy processing between the read and the write, so you probably won't be able to speed up the actual execution time between the Read and Write.  But my earlier suggestions should give you a faster response.
-Alan A.
0 Kudos
Message 2 of 2
(2,571 Views)