ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx Timing Issue

I am working on a nuclear magnetic resonance project and need to take samples at a high rate from my USB-6009 DAQ.

The specific part of my program that I am having issues with does two things

1) Outputs an increasing then decreasing voltage from 0 to 5 to 0 Volts (which is connected to a power supply, though this is irrelevant to my question.)

2) Wait's a specific amount of time (around 10ms)

3) Reads a voltage coming out of a Lock-in Amplifier

 

The way I have the program written, I can't sweep through quickly enough (I am hoping to be able to read 200 samples and write 200, in alternation, in about 1 second). I have included a picture of the particular part of my program. After investigating further into this problem I have found that the limiting factor is the Read Voltage VI in the flat sequence structure. It takes much longer to run just the Write VI than the Read VI.

 

I know one solution is to use two DAQ's and the timing VI's, however, I need to know that it is reading then writing and never doing a read, read, write, for example.

 

Is there a way to make a reliable, fast Read/Write loop for what I need to do?

 

Thanks

0 Kudos
Message 1 of 4
(2,728 Views)

Did you set up a Sample Clock upstream? What is it set too? Maybe it is waiting on available samples. What you are doing is not terribly fast (200 reads and 200 writes in a second).

 

 

Did you know that the For Loop will iterate by the number of elements in "V" and not "Number of Steps"? Don't auto index AND wire the N terminal!

Richard






Message 2 of 4
(2,699 Views)

 


@broken Arrow wrote:

Did you set up a Sample Clock upstream? What is it set too? Maybe it is waiting on available samples. What you are doing is not terribly fast (200 reads and 200 writes in a second).

 

 

Did you know that the For Loop will iterate by the number of elements in "V" and not "Number of Steps"? Don't auto index AND wire the N terminal!


 

Yes, we need to see how you configured your DAQ task to see if there are problems.  This is not enough info.

 

BTW, if you wire a for loop's count terminal AND index it, it will iterate based on the smallest value.  Wiring a 10 to a for loop that is auto-indexing a 5 element array will get you 5 iterations.  So will wiring a 5 to a for loop that is auto-indexing a 10 element array.  Same goes for multi-indexed loops.  The loop runs until ANY input array runs out of data (or the count is reached).

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
Message 3 of 4
(2,684 Views)

@NIquist wrote:

 

BTW, if you wire a for loop's count terminal AND index it, it will iterate based on the smallest value.  Wiring a 10 to a for loop that is auto-indexing a 5 element array will get you 5 iterations.  So will wiring a 5 to a for loop that is auto-indexing a 10 element array.  Same goes for multi-indexed loops.  The loop runs until ANY input array runs out of data (or the count is reached).


Good clarification NIquist, appreciate it.

Richard






0 Kudos
Message 4 of 4
(2,672 Views)