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

How to log data in different rates in a single VI?

$
0
0

Hi, 

i tried to acquire 2 channel of voltage measurement at 10KHz and then analyze the data, finally record the data at both 1KHz and 1Hz. What i have done is that use producer/consumer loop to achieve the recording work at different rates. I enqueued all the data in the main loop, and then dequeued the data and write them into file in other loops. I added 'wait=1 ms' in one consumer loop to achieve data logging at 1KHz (fast logging loop), and added 'wait=1000ms' in another loop to achieve data logging at 1Hz (slow logging loop). 

 

My problem is that the data logging works really well in the 1Hz case but it doesnt work for 1KHz case. Although the wait time set as 1ms, the interval between two samples in the fast data logging loop is around 100ms.  Afterwards, i tried 1ms, 10ms, 100ms,150ms in this loop to see what the intervals are in those cases. I found that the intervals are same as assigned in the wait time greater than 100ms, but if the wait time is set as 1ms or 10ms, the intervals are again around 100ms. 

 

My question is that why i can not achieve 1KHz data logging by using consumer/producer loop whilst the same way works for 1Hz case? 

 

 

Many Thanks,

Hao 


Viewing all articles
Browse latest Browse all 66782

Trending Articles