01-09-2015 03:38 PM - edited 01-09-2015 03:40 PM
I am using a LabView code (attached) for real data logging. The maximum attainable sampling frequency is about 25 Hz which is much less than what is expected. As inferred from the loopt ime indicator, the lowest reachable loop time is about 25 ms (when the sampling frequency is set to 25 or higher) that seems too long for such a simple code. I would like to add that the data acquisiton boared used ( PCI-DAS6013) is able to acquire data up to 200 KS/s.
Any help and technical guidance is much appreciated.
Farzam
01-09-2015 03:45 PM
A few quick comments:
1. There is no need to have 7 different tasks set up for this. Acquire all your channels in one task!
2. You can always move your "Write to measurement file" in to a separate loop. That will speed up your acquisition.
3. You can always acquire more than 1 sample at a time to get the correct acquisition rates if your loop is running slow.
4. You are limiting your loop iteration rate by adding "Wait until next ms multiple" in to it. There is no reason I can see to have it in your loop.
01-09-2015 09:02 PM - edited 01-09-2015 09:12 PM
5. Don't create the virtual channels on every iteration of the while loop. Besides slowing down your code, you are bleeding away resources and your code could eventually crash. You should create the tasks/channels before the while loop, read them in teh while loop, and close them after the while loop which you failed to do here.
6. You don't need a separate numeric indicator with each chart. Right click on the chart, Visible Items, digital display. Now you can delete the extra indicators.
7. The Save Data button should be inside the while loop. Right now it is only read once immediately after you start the VI.
01-12-2015 11:03 AM
Bowen M: I really appreciate your constructive somments. Regarding the 3th point, I wonder how I can acquire more than one sample at a time and how this trick can control the loop rate. I would also like to know how one can reach the desired sampling frequency without using "Wait until next ms multiple" or any similar command.
Thanks again for any help.
01-12-2015 11:04 AM
Ravens Fan: Many thanks for the comments. I am trying to apply them and see how they will decrease the loop time.
01-12-2015 03:04 PM
@Farzam wrote:
Bowen M: I really appreciate your constructive somments. Regarding the 3th point, I wonder how I can acquire more than one sample at a time and how this trick can control the loop rate. I would also like to know how one can reach the desired sampling frequency without using "Wait until next ms multiple" or any similar command.
Thanks again for any help.
Just use the DAQ assistant. This article answers all of your questions:
01-12-2015 03:55 PM
01-12-2015 04:27 PM
@Dennis_Knutson wrote:
No, that cannot be done. The DAQ Assistant is only for NI devices that user DAQmx. The DAS 6013 is from Measurement Computing. There are functions in their driver to set a sample rate and to acquire multiple samples, though.
Oh. You are right... I looked at his VI again and realized those were not DAQmx drivers he was calling - and I don't have the package installed. Sorry!
01-12-2015 04:33 PM
BowenM and Dennis: Thanks for your comments. Yeah, it is not as stright forward as DAQ assistant and for the same reason it seems that using "Wait until next ms multiple" is unavoidable to contro the sampling frequency.
BowenM: I wonder how a separate while loop can boost the sampling rate. Applying all recomended comments but No 2, the sampling frequency reached 100 Hz, however , it is not high enough. Thanks
01-12-2015 05:33 PM