From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
04-28-2015 06:30 AM
Hi all,
I am using Data acquisition system with rate 10000 and 1000 sample per channel (exist 4 channels) to acquire analog voltage signals to measure the amplitude in each channel.
Moreover the raw signals are saved as TDM file of 1 minute. The system is running continuously for one week. I noticed that after 3 hours the saved file size is decreased as a function of time.
The size starts with 50 MB/min and after 3hours it became 42MB/min, after 1 day became 11MB/min. That indicated the data was lost , please, what is my programing mistake.
Thanks
Solved! Go to Solution.
04-28-2015 06:33 AM
Hi MAAM,
two points:
- Don't use an additional wait in your DAQ loop. Timing is maintained by the DAQmxRead function and the sample rate…
- Put the file save function in a parallel running loop - same as your chart display. File functions may have a big impact on loop iteration times, and more worse: impact isn't predictable at edit time…
04-28-2015 06:46 AM
Hello GerdW,
Thanks for response,
you mean something like this,,
04-28-2015 06:53 AM
04-28-2015 07:08 AM - edited 04-28-2015 07:09 AM
Thanks again GerdW,
Here I initiate another queue,
What about restart the program automaticaly after certain time or when an error occurs, is it good idea?
Thanks
04-28-2015 07:15 AM
GerdW wrote: - Put the file save function in a parallel running loop - same as your chart display. File functions may have a big impact on loop iteration times, and more worse: impact isn't predictable at edit time…
Even easier is to just use the DAQmx Configure Logging function. It just streams the data to a TDMS file. No need for an addition queue and loop for logging of the data. There are also properties to make DAQmx use multiple TDMS files automatically when X samples are saved.
04-28-2015 07:57 AM
04-28-2015 08:31 AM
Hi crossrulz and Mike,
Appreciate your response.
Actually I had just starting use queue, because I think it will solve the problem of two different execution rate. I have three target from this program: firstly, acquire data with 1kHz continuously for one week. Secondly, save all the data during this period. And lastly display those data.
Previously I am using the attached vi (Zero stage) but the diminish of the saved data with time change my mind to use queue.
This program can save the data to TDM file every minute, also it's able to cancel errors and run again, but it has the limitation of data loss after 3 hours of continuous operation. for me I hope to overcome
the problem using this VI.
Thanks
04-28-2015 09:24 AM
From the State Zero code, there are several things that could be improved here.
1. You only need to create the task once before your main loop.
2. You probably do not even need the outter loop if you use the DAQmx Configure Logging like I have already stated. And you can use properties to say how many samples to go into a file before moving on, so that part of your code is eliminated.
3. The display can just be a simple chart (it looks like you are probably already using a chart).
What is your chart history set for? That could be causing your slowdown if there are too many data points.
04-28-2015 10:06 AM
Hi Mike,
If I create the task once before the outer loop then, it will not be possible to re-run the VI again if one of the three terms of the inner loop is met ( elapse 60 econds, error occurance or stop botton).
Regard to the display, I just got attention to that, I am using graph, Now I change it to chart of 1000 history size.
For DAQmx Configure Logging, I didn't understand well how to use it, i try to use it, but it runs once and the stop,, I am sure that I didn't understood the functionality of it well, can you state me for some example ,.
Thanks again,,,