Multifunction DAQ

取消
顯示結果 
搜尋替代 
您的意思是: 

Voltage and temperature measurements with 6221 and USB TC1

已解決!
前往解決方案

Hi

 

I'm making a program to make voltage measurements with a PCI 6221 37 pin board and temperature measurements with a USB TC01. I use Labview 2009 SP1, and basically my program reads the data, shows it in a chart, and saves it to a file, all within a While loop which runs until I stop the program.

 

The program is enclosed. I wasn't too sure about timing with the 2 devices. The TC01 runs at a fixed rate, so I set DAQmx read to 1 Chan 1 Samp. On the 6221, I set a sample rate and chose "continuous samples", set DAQmx read to 1Chan Nsamp, and set "samples to read" to "-1". And it seems to work fine, but just setting "samples to read" to -1 seems too easy. Am I missing something. What determines the speed at which the loop runs ?

 

Thanks 

0 積分
1 條訊息(共 5 條)
3,652 檢視

The speed of the loop is determined by the time it takes all the code inside the loop to execute.  The Write to File VIs may be the slowest elements.  As the file grows the OS may need to re-allocate file space which could take some time.

 

The temperature measurement device may run at a fixed rate, but does the AI read wait for a new result or just repeat the previous result if you try to read again before new data is available?  Does it make sense to write one sample to the file at a time? Perhaps accumulating data for some period of time and then writing a "chunk" of data might be more effective.

 

There are a variety of ways to set the timing on a loop.  What do you want the timing to be?

 

Lynn

0 積分
2 條訊息(共 5 條)
3,647 檢視

I'll be measuring low frequency signals (about 0.5 Hz). My only constraint for timing is that the graph should be updated fairly often, so that the user can observe the measurements in almost real time. So 1 loop could take say between 100 ms and 1s.

0 積分
3 條訊息(共 5 條)
3,645 檢視
解決方案
由主題作者所接受 scalpas

Try putting a Wait (ms) function in the loop.  Set the wait value to 100 to 1000 ms.  If everything else happens faster than that, then the wait will determine the loop rate.

 

Lynn

0 積分
4 條訊息(共 5 條)
3,617 檢視

Yes that works. Thanks !

0 積分
5 條訊息(共 5 條)
3,612 檢視