ni.com is currently undergoing scheduled maintenance.
Some services may be unavailable at this time. Please contact us for help or try again later.
06-11-2015 06:21 PM
Hello NI Community,
I am currently trying to write a VI that creates a new TDMS file every hour and records displacement data from my CompactDAQ Ethernet Chassis. Please see the code attached. Right now the code only appends the current TDMS file and does not write a new file on the given time interval. I would like for a new file to be created every hour, so the files do not get insanely big.
Also my displacement data is not writing data anywhere near the correct collection rate. Right now it seems to be collecting one data point every second, where I have the collection rate at 100.
Any advice would be greatly appreciated!
Thanks.
Chris
Solved! Go to Solution.
06-11-2015 06:58 PM - edited 06-11-2015 06:59 PM
1000 points at a rate of 1000S/sec. That means the DAQ Assistant will take 1 second to read the data. Now going through the process, you are just getting the first waveform and then taking the first point in that waveform. Therefore you get 1 sample from the 1000 that you spent a second capturing.
So here are a few things I would suggest.
1. Change your graph to a chart. A chart keeps a history and it can take the array of waveforms directly. There is no need to further append any data for this chart.
2. Play around with the scales in the DAQ Assisant. You can apply a linear scale to the individual channels, eliminating the need for that FOR loop.
3. Use the Logging option in the DAQ Assistant (there is a tab just for this). You can enable TDMS logging and it will do everything for you. You can even have it span multiple files based on the number of samples.
So after all of that, your code should be reduced to something like this

06-17-2015 10:25 AM - edited 06-17-2015 10:41 AM
Thank you very much for your help on this topic. I was unaware that the DAQ assistant could enable TDMS logging. I will try and implement this today, and I will let you know what the outcome is.
Thanks again,
Chris
Edit: The logging through the DAQ assistant couldn't be easier. Thanks for the help.
06-17-2015 12:30 PM
I am now able to write TDMS files at given sample intervals, however the only data saved is the displacement. Is it possible to also write the raw data and timestamp to the same TDMS file through the DAQ assistant?