05-14-2009 02:57 PM
Hi there,
I'm using using NI cDAQ-9172 and NI9237 to record the load cell data. The vi file I used is the example from http://zone.ni.com/devzone/cda/epd/p/id/5902.
My question is: does calculating mean value slow down the program? I think that' the issue between 'number of sample per channel', 'data rate' and 'mean value of waveform'.
When not including the 'mean' function in the VI, I set up the data rate of 500 and number of sample per channel is 50. I understand the NI 9237 has the minimum data rate of 50KHz/31=1619.2 Hz. The data rate will coerced to the lowest rate. The VI run normally without slowing down or error report.
But When I included the 'mean' function as shown in the attachment, the VI runs slower and slower, finally stopped and reported the error:
Error -200279 occurred at Addax Read (Analog Wfm 1Chan NSamp).vi:1
Possible reason(s):
Measurements: Attempted to read samples 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 want to calculate and output the mean value of the (50) samples in one channel each time the ' DAXmx Read' is called. Is my VI calculate the mean of each 50 samples or it calculate al the data accumulated? I also increased the data rate to 2000 and sample per channel to 500, it still has the same error. Do I need to put the mean function in a loop ?
Any help would be appreciated!
05-15-2009 03:18 PM
Hello,
Thank you for posting to the NI Forums! Is there any chance that you are logging the data to a file in this vi? Often times the time it takes for the data to log can slow down the vi such that we may get an error like the one you are receiving.
For further suggestions, please take a look at the two knowlegebase articles linked below. Have a great day!
05-18-2009 10:57 AM
Hi Margaret,
Thanks for your reply.
I do save( write) the data to a file in my vi. I will try the examples and will let you know how it works.
Melody