12-20-2016 11:30 PM
Hii,
I am have written code for data acquisition at 1M sampling rate which is writing tdms file of 1 minute. The file is being written every minute but somehow the code is not running properly, it stops automatically sometimes, and at times it gives memory full error. Earlier it was working perfectly. i have not made any changes since then. I have a backup code also, and both codes have no difference. One is working perfectly fine and other one is creating problem. Kindly help me with this.
12-21-2016 05:59 AM
@shivam_2 wrote:
I am have written code for data acquisition at 1M sampling rate which is writing tdms file of 1 minute.
Writing to a TDMS file? Use the DAQmx Configure Logging to have DAQmx stream the data to a TDMS file. This will eliminate the need for the Producer/Consumer and will run a lot more efficiently.
12-21-2016 06:43 AM
You should keep your topic in one post. Why did you create a new one?
Duplicate post, original discussion is here:
12-22-2016 04:49 AM
hello sir,
will it work for 1M sampling rate also? Because we used that earlier it was logging just 12 seconds of data in one minute.
12-22-2016 05:11 AM
shivam_2 wrote: will it work for 1M sampling rate also? Because we used that earlier it was logging just 12 seconds of data in one minute.
I have had it work with a 1MS/s. You might have had something wrong with your setup. Post some code and we can have a look.
12-23-2016 02:23 AM
hello sir,
i have attached the code. Its showing me error currently.
12-23-2016 05:42 AM - edited 12-23-2016 05:42 AM
1. You need to use the DAQmx Configure Logging before starting the task.
2. You likely are having the problem of overrunning the buffer. Read a bunch of samples in a loop to keep the buffer clean.
3. You can greatly simplify the building of the log file name with a Format Into String.
12-25-2016 11:57 PM
Thank you so much sir, i will definitely apply these things.
Also, I haven't used the string to name the logged file, bacause ultimately I want to save files for a variable time say 15 secdonds or one minute. data has to be acquired constantly for 8 hours but different files have to be created according to the time span which we want.
Regards
Shivam
12-26-2016 01:18 AM - edited 12-26-2016 01:22 AM
hello sir,
I tried that code , its loggong the data perfectly but i have encountered error -200279. Plus waveform graph is not shoing me any data.
Also, how should i provide time stamping to my channels.?
12-26-2016 08:34 AM
@shivam_2 wrote:
I tried that code , its loggong the data perfectly but i have encountered error -200279.
Try reading 1000 samples per iteration. You might be trying to read too may samples than the buffer can hold.
Plus waveform graph is not shoing me any data.
I would change them to a Chart. I would also not use the Split Signals. Just use 1 chart and let all the signals be displayed in it.
Also, how should i provide time stamping to my channels.?
DAQmx is doing that for you in the charts and graphs. In the TDMS file, just the start time and sample rate is stored. You can easily calculate the timestamps and add a channel to your task afterwards.