Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

digital frequency and analogue measurement

hi, steve, the problem is solved. However, there is another one 200279 occurred at anaalog reading, saying attemted to read sample s that are no longer available the requested sample was previously available but has since been overwritten. Increasing the buffer size, reading the data more frequently or specifying a fixed number of samples to read instead of reading all available samples might correct the problem.

 

I checked the knowledgebase for 200279 and one solution is to change the samples to read 1/10 of the rate which i did. I increase the task clock settings to rate:5000 (it was 1000) and the samples to read500(it was 100). i still had the same problem.

 

I think the data writing was quite slow though, not once per second as I expected.

 

How can i read the data and show them in the display at a more frequent rate (more accurate) but only write the data once per second?

 

thank you so much

0 Kudos
Message 11 of 16
(1,120 Views)

Hi,

 

I believe the reason you are seeing this error is because you are trying to write to the file at a rate of once a second, and because the Write to Spreadsheet file vi is performing a fairly intensive process (opening the file, writing to the file and closing the file once written to) every time it is called, it is slowing down the loop rate, so som samples are being overwritten in the buffer.

 

One way to overcome this issue is to write many more samples to the buffer at a time, but of course you wouldn't be able to write to the file as often as you would like.

 

I have written a little example VI to demonstrate another possible solution, where you pass the data acquired into a queue, and then write the data to a file in a parallel loop, thus not slowing down your DAQ loop.

 

I hope you find this information useful.

 

Regards,

 

Steve

Message Edited by StevenH on 02-25-2009 12:37 PM
0 Kudos
Message 12 of 16
(1,104 Views)

Hi, steve,

 

Sorry for my late reply.  Could you please send me the 8.0 version of the program. thanks a lot

0 Kudos
Message 13 of 16
(1,088 Views)

Hi,

 

Here's the code saved in LabVIEW 8.0

 

Regards,

 

Steve

0 Kudos
Message 14 of 16
(1,086 Views)

Hi, Steve,

 

Sorry to bother you again. I tried to incorporate the program you suggested into the vi. The same problem occured and the program stopped after a few seconds. only one set of data was recorded. 

0 Kudos
Message 15 of 16
(1,083 Views)

Hi,

 

What I think is happening is that basically becuse your counter read is still waiting on a timeout, the samples in the analogue input FIFO are being overwritten which is causing the loop to stop iterating.

I have confirmed this by using a Diagram Disable structure (from within the Structures palette) and placing it around the Counter Read function. The VI then runs as expected.

 

There are some examples of use counters in the LabVIEW Example Finder by navigating to Hardware Input and Output » DAQmx » Counter Measurements

The following article may also be a useful resource: Frequency Measurements: How-To Guide

 

Hope this helps.

 

Regards,

 

Steve

0 Kudos
Message 16 of 16
(1,067 Views)