08-22-2017
09:09 PM
- last edited on
02-07-2025
04:33 PM
by
Content Cleaner
Hi,
I need to continuously write data from the analog inputs from my DAQ card (NI-USB 6212). The input data produced by a sensor [time (t) and voltage (v)]. The frequency and data samples are high (high speed acquisition data). I need to record my data in a certain period of time (10-15 minutes).
I try to use "producer consumer loop architecture", but the problems is on the binary output file. As far as I know, a binary file is not a text file (I got the producer consumer loop architecture from https://forums.ni.com/t5/Community-Example-Submissions/Using-Producer-Consumer-Architecture-for-DAQm...).
I also try to use continuous data logging with TDMS File (https://www.ni.com/en/support/documentation/supplemental/06/the-ni-tdms-file-format.html). There is a problem in DAQmx Start Task.vi., the vi can't be executed.
I have attached the vi. Hopefully, someone can help me out.
Thanks,
Jannus
08-23-2017
06:08 AM
- last edited on
02-07-2025
04:33 PM
by
Content Cleaner
jannus wrote:
I also try to use continuous data logging with TDMS File (https://www.ni.com/en/support/documentation/supplemental/06/the-ni-tdms-file-format.html). There is a problem in DAQmx Start Task.vi., the vi can't be executed.
What do you mean by "can't be executed"? Are you getting an error? Broken run arrow?
The only real issue I see with the TDMS logging is that your read should be inside of a loop so that you continuously get data until you tell it to stop. Other minor issues include:
08-27-2017 07:48 AM
Hi crossluz,
Thank you for your reply.
By following your advice, I have run the *vi. There is no error message (also no broken arrow). But, there is no measurement or test data in the tdms file.
I have one more VI file for the same purpose (writing data in *.tdms file). I have gotten the VI also from this discussion forum. I can run the *.vi and open the *.tdms file. But, data logging in 10 seconds and 60 seconds will give the same number of data point. Both of tdms files will only have the same data point (for a certain of rate/Hz), for example 26624 points for both of tdms files (samples=10K & rate=50K Hz). I really hope I can log my data continuously about 10-15 minutes and also get more data point for longer logging/recording. Can the VI be used for the purpose ?
The VI I have used is attached. Thanks a lot.
Best regards,
Jannus
08-27-2017 06:45 PM
Your DAQmx Stop should be AFTER the loop.
The other change I would do is change your file setting to be "Create" instead of "Open or Create". This way, you are not adding to old data accidentally.