05-04-2017 02:11 PM - edited 05-04-2017 02:13 PM
I am using the following program to log the analog channels from a measurements computing daq board. Basically, I would like to collect the data every 0.5 seconds. It works great for several minutes (4 - 5 min?) but then the sampling rate gradually increases. I need the program to sample at this high rate so I don't miss my measured event. Any help is appreciated.
05-04-2017 02:25 PM
I am not familiar with the MC products, but you should be able to put all of your channels into a single task and perform the read all at once. There should also be a timing setup VI so that you can have the hardware perform the sample rate instead of your software.
05-04-2017 03:03 PM
I'm not 100% on the underlying operation of the write to measurement file express VI but given your description, I think this is probably the most likely cause of the problem, with increasing file size slowing down the opening and writing operations. How big are your data files are the few minutes that you have had the program running?
As a quick test on whether this is the issue or not, try moving the file name creation inside of the while loop, this should move it to recording the data into minute long files and limit the size of the files.
05-04-2017 03:14 PM
I'm sorry, but I just don't "get it". I think your device is similar to NI's USB-600x series of modules, capable of multiple channel A/D at speeds up to a few KHz. You are talking about taking samples at a very slow rate, 2Hz, for a few hundred seconds, so you'll have at most a few thousand points to handle. Yet you say that the sampling rate increases as time goes on ... (I might expect a decrease if the amount of data became too much to handle in half-a-second).
Some suggestions:
Often trying "pieces" of a program can be a quick way to isolate the problem spots.
Bob Schor
05-05-2017 07:08 AM
Hello sir,
I am sorry I misspoke. What I meant to say was the time between samples gradually increased. The program starts our at a sample every 0.5 seconds, but by the end of my testing it is sampling every 1 second. Thank you, for your input.
05-08-2017 09:48 AM
I still believe the steps Bob provided will allow you to isolate the problem.
Quote:
Some suggestions:
Often trying "pieces" of a program can be a quick way to isolate the problem spots.