LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to counter data skips while acquiring using LabView

Dear enthusiasts:
I am using PCI-6031E measurement hardware and a self built LabView program to acquire data from a mp3 player. I am using AI configure, AI start and AI clear(Labview commands) in a loop so that buffer is cleared after each second(say). This is an improvement on its earlier version as it doesnot store the whole length of data in a buffer preventing crashes.But since I am configuring and starting data acquisition after each second, my data has skips at the beginning of each second. How do I modify my program to counter this. I am attaching a jpeg file to show the skip and the labview program.
0 Kudos
Message 1 of 4
(2,901 Views)
Your first program is really the way you want to go. To prevent glitches in a continuous acquisition you certainly only want to do the Configure, Start, and clear outside of the loop. To prevent problems in this configuration you can tweak a couple things. First, the buffer size doesn't have to be as large as your entire acquisition - in fact it doesn't need to be anywhere near that large. Usually 2 to 3 times the amount of samples you are reading at a time should be sufficient. Second, you can alter the amount of samples to read at a time in the loop. The larger the number, the less overhead there is since you are grabbing larger chunks from the buffer at a time.

If you continue to have problems with the original program, just post back. Also, in the futur
e, I would recommend posting to the LabVIEW or DAQ group rather than DSC - you'll get a lot more and quicker responses that way.
0 Kudos
Message 2 of 4
(2,900 Views)
Thanks Matt. Second suggestion helped a lot. But changing the buffer size is still not clear to me as...
the original program was built so that program stops acquiring once the buffer is full. So if chose a small buffer length, acquisition will not run for the entire length. Correct me if I am wrong.
0 Kudos
Message 3 of 4
(2,900 Views)
The buffer is meant to be used as a temporary storage location for the data. When data comes in from the board it is place in the buffer and then you read it from LabVIEW. Once the data has been read out of the buffer into LabVIEW, that portion of the buffer is available to the DAQ board to once again write data. Thus you only would need a very large buffer if you couldn't read the data into LabVIEW very fast.
0 Kudos
Message 4 of 4
(2,900 Views)