You can ignore that last file, this one sort of works, but the data write is not all of the data from the individual elements in teh queue just the whole queue. Still working on adding the time stamp too.
1. Do not wire up the "samples per channel" input on the DAQmx Timing. All you are doing it limiting the buffer size. Let that be the default. You will likely run into overrun errors if you do limit the buffer size.
2. You don't need the DAQmx Start New File. You only use that while you are reading if you think your file size is getting too large or an event happened that makes you want to start a new file.
3. Why are you using the Producer/Consumer and the DAQmx Configure Logging. You should probably just be using the Producer/Consumer setup.
4. Change the data type of your queue to be an array of waveforms.
5. Be sure to send something to your consumer loop through the queue to tell it to stop. I like to send an empty array in cases like this. Only destroy your queue AFTER your consumer loop is complete.
6. Make sure you are closing your TDMS file.
7. Change the DAQmx Read to be NChannels N Samples. Leave the number of samples to read unwired. This way you will read everything that is available.
This is where I am at now. You can ignore all the fill bars, they are for another part of the display but will also be representing a voltage in some capacity. What is wrong with using the daqmx logger? it seems pretty fast and reliable (minus the time stamp) but it logs start time and I have another file now to sync up with that is recording the times. I will be adding an event marker button to the queue as well so that I can mark in the time file when things happen.
I did some cleaning up for you. But I'm confused. How do you want to save your data? TDMS or text file? I recommend the TDMS file using the Producer/Consumer setup. Might need some tweaks to get it right, but it should work just fine.
I really like how the daqmx tdms log stores the data in different sheets automatically, and labels all my channels as the column headers. The only drawback was the time stamp issue but the txt file hadnels that and once i add the event button i can correlate the data to time taht way.
I need to keep track of 32 channels of voltage data by the end of this. I am thinking I might use two laptops and make an executable for half so that I don't have so much going on in one VI though.
I added your cleanup recommendations, but the time file is very repetitive. I get 3 timestamps that are identical every time the loop runs. Am i sampling too fast or is this a queuing problem?