I met a problem when running TDMS Logging From Multiple Tasks Example downloaded from NI website. Error 200279 came up after running for several seconds, which suggested increase the size of buffer. While the sampling rate was only 100Hz as default. So I added an indicator to monitor the queue size, and found it was zero before error coming up. I am confused. Could anyone help fix this problem for me, please? Thank you so much!
Solved! Go to Solution.
You need to add a property node of buffer after setting the clock. Select input buffer size and set to 20000 or more. I have attached the example for the same in case you are not able to find buffer property node.
at a samplerate of 100Hz you should not get a "buffer overflow" error…
Read the LabVIEW help for the DAQmxTiming function, especially the comments on the buffer size input in "Continuous samples" mode! Then delete the wire for buffer size and leave it unwired…
Thank you! I find it works when I increase the buffer size to 30000. While a new problem comes up.
I have to clarify that task1 is running on virtual 9215, and task2 is on virtual 9234. The time length recorded by 9215 is 15 times of that by 9234 (See attached picture). Could anyone help me to solve it? Thank you so much!
Thank you! I run the code with large buffer size for a longer time and find that the problem is still not fixed. Please look at the tests I made as below, it seems the error is due to using different cards. The time-lengths recorded by different card are different as mentioned in previous post and picture.
task1-virtual 9215, task2-virtual 9234, virtual chassis 9188, sampling rate 100Hz, buffer size 100000, error came up after running for 68s.
task1-virtual 9215 in virtual 9188, task2-real 9234 in 9171, sampling rate 100Hz, buffer size 100000, error came up after running for 68s.
task1-virtual 9215, task2-another virtual 9215, virtual chassis 9188, sampling rate 1000Hz, buffer size 100000, no error after running for 15min.
task1-virtual 9215, task2-another virtual 9215, virtual chassis 9188, sampling rate 10000Hz, buffer size 100000, no error after running for 5min.
task1-virtual 9215, task2-another virtual 9215, virtual chassis 9188, sampling rate 25000Hz, buffer size 100000, no error after running for 5min.
The minimum sampling rate for the 9234 is 1.652 kSa/s.
So 100 Hz sampling is out of the question for this card.
Rather than have two tasks, you can combine them in one task using channel expansion; that way both cards are synced together. However, 1.652 kSa/s will still be the minimum sampling rate.
Thank you for your advice! Yes, it works if I put them in one task. But I intend to run them at different sampling rates eventually. So I start with run them in different tasks but same sampling rate. Jus now I tried with two different 9234s and no error came up. Hence I am sure that it may be a synchronization problem.
The 9215 is a SAR device, the 9234 is a DSA device. They sample differently. The 9234 has a Master timebase; sampling rates for the 9234 follow a distinct formula (Fm/256)/n, where n is 1 to 31, Fm is the frequency of the master timebase. Look in the data sheet.
The 9215 is a muxed acquisition module whose sample rate depends on the master timebase along with the number of channels selected.
Since they do not share a common clock, this is true when using two tasks, acquisition will never be synchronous. If you need synchronous acquisition, then you have to combine into a single task; then a clock is shared. I do not know enough about cDAQ to say if it is possible to make two tasks synchronous that have different sample rates. This can be done on a PXI system where you have additional clocks in the backplane, 10MHz and 100MHz, that you can use to try and synchronize modules.