Quantcast
Channel: LabVIEW topics
Viewing all articles
Browse latest Browse all 70145

Acquiring with DAQmx within a subVI

$
0
0

Hi,

 

I am a bit confused as how to use DAQmx

Lets say I have a rate of 1000 Hz, and I want 1000 samples. This will take 1 second to complete (the while loop iteration / code will take 1 second)

If I use 10 Hz and 1 sample, I will get 10 samples a second, with the loop taking 0.1 seconds to execute

 

However, this is when I have DAQmx clock outside the while loop and DAQmx read inside. 

If i make a subVI with the code all together, it will operate much faster than 0.1 seconds. Lets say 0.01 or 0.001.

As such, I have had to put a 100 ms wait timer in my loop in the main VI, and this makes it only access the DAQ data every 0.1 seconds.

But I am guessing this is not very efficient? Whats the best way for me to get 10 data points per second (I dont want 1000s per second written to the CSV file) with DAQmx?

 

I have uploaded the files in a zip file for Labview 2010

 

"ProducerConsumerMagnetometer.vi" is the main VI. This has 'acquire channel data' which acquires data. This subVI is in the mainVI in a while loop. Inside 'acquire channel data' is another subVI which takes the waveforms, and takes the waveform component out of them. There are also subVIs to interact with the analog output, digital input/output and timechecking


Viewing all articles
Browse latest Browse all 70145

Trending Articles