07-06-2010 10:43 AM
Hello,
I have a 6143 data acquisition card and want to sample different instruments connected to 8 channels. I have used the attached code and noticed that this is running at a very low speed. I really need to speed up the code because I am going to put this code in a bigger one and really need to make it as fast as possible.
I have been playing with the number of samples per channel and sampling rate as well as the finite and continuous acquisition. For example, I think the data acquisition with sampling rate of 1,000,000 Hz and 1000 samples per channel should take 1000/1,000,000 s or 1 ms while the fastest acquisition time is 47 ms.
Any help on this is appreciated.
Thanks,
07-06-2010 11:05 AM
There is no need to create and clear the task with every iteration. The only thing you should have inside the loop is the DAQmx Read and your RMS function. Your method of calculating the time is also flawed. You should iterate an inside loop x number of times and then divide the overall time by x. The windows timer just does not have the resolution otherwise.
If you plan on calling from a top level VI, then the top level VI should create the task and clear it.
07-06-2010 01:35 PM - edited 07-06-2010 01:37 PM
Thank you very much. Your advice helped a lot. The only think I am worried about is that the modified code seems to get constant DC values in comparison with the old one because the DC value array is not changing during the data acquisition in contrast with the old code. I just want to make sure that the code is not just fetching the data from one acquired sample.
I also want to sample another 6143 card on my system and don't know how to modify the code so that it gets the data from 16 channels at the same time. Should I duplicate the current code? If yes, the question is that how I can make sure that they are running at the same time.
Thanks,
Ahmad
07-06-2010 02:27 PM
The indicator can't change during the acquisition because it is outside the loop.
There are examples of synchronizing multiple boards (Help>Find Examples). Beyond pointing you to them, I can't help much.