03-08-2012 08:09 AM
Hello All,
I have a data acquisition task, as shown in the attached file. In order to speed up the data acquisition process, I am planning to first acquire and save the data into an array, and then write the whole chunk into a txt file. I have searched a lot, but I could not find how to do this. Can someone instruct me or give an example link to do so.
Thanks.
Amir
03-08-2012 08:37 AM
Hi Amir,
I found de following example for you:
https://decibel.ni.com/content/docs/DOC-11300
This example acquire data and write after the acquisition the data in a TDMS File.
I think this example will help you.
03-08-2012 09:24 AM
Thank you very much for you help. But I have two more questions:
1- The TDMS file, as pops up at the end, does not have the corresponding time stamps for each acquired voltage value. How can I store the time stamps in the same file as well?
2- I have another dependent measure in the loop that I need to store it in the same file. How can I add this value to the TDMS file so that at the end I can have that as well.
Basically I need three colums in my output TDMS file:
1- Voltage values
2- The time stamps correponding to each acquired voltage
3- Another dependent measure, which is computed within the loop
Thanks.
Amir
03-08-2012 09:36 AM
Hi Amir,
with the TDMS Write.vi you can add Channels and Groups to your TDMS File.
The following example write random values in specific groups and channels.
https://decibel.ni.com/content/docs/DOC-5789
03-08-2012 11:41 AM
Hi Again,
I have cutomized the example for my application. Attached you can find my code. But there is still a problem. At the end of the trial, as set by the total time (sec), the TDMS file does not show all the values, i.e. it is too short. Where are the other values? I thought I saves all data points!
Additionally all the measurements are 0. I have connected it to the clock source but they are all still zero.
Thank you for your help.
Amir
03-09-2012 02:50 AM
Hi Amir,
Remove that 100ms wait vi from 2nd loop and connect 100ms to timeout terminal of dequeue element.
I hope that will work.
Regards,
Bijay
03-09-2012 02:59 AM
Hey,
at first please allow debugging in your VI. With debugging you can set probes, which help you understand the function of your VI:
http://digital.ni.com/public.nsf/allkb/22729F1BAC6BBDD086256FDC005FE8FD
What clock source do you connect to your Dev1/ctr1? Did you check your clock with a scope?
(Dev1/ctr1 is not the internal clock!)
I did some changes in your VI:
Xenox
03-09-2012 03:06 AM
Hi xenox,
Try this....
Go to VI properties > category Execution >check Allow debugging.
Continue with work.
Regards,
Bijay
03-09-2012 03:10 AM
Hi Bijay,
i know
have a look at my link I posted before:
http://digital.ni.com/public.nsf/allkb/22729F1BAC6BBDD086256FDC005FE8FD
03-14-2012 04:44 PM
Hi Bijay,
and thanks for your response. Unfortunately I could not open your example code, since it is written in a higher labview version as mine, which is 8.6. Can you help me with an example that the queue is filled in two different loops. In the example above, all values are stored in a single loop. What if I want to store x value from loop 1 and also store y value from loop 2. can I add them to the same queue? or I have to use another queue?
Thanks.
Amir