Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

My algorithm process data sample by sample. What is the best setting to use in order to measure and send the signal to my algorithm in real time and point by point (sample by sample) and not as a group of 1000 samples?

What I can’t understand is the difference between the continuous acquisitions and the N sample ones.

 

  1. I have recorded a signal using the acquisition method of N samples (1000 samples). I saved the recorded signal into a LVM file.

  2. I made an algorithm which reads the recorded LVM file point by point. My algorithm runs having as input one point per iteration. With the recorded signal my algorithm works great.

  3. The next step is to try my algorithm in real time environment taking measurements from a Daq card instead of reading point by point the LVM file.

  4. As far as I can understand the N samples method is not suitable because it groups the data before it sends them to labview and hence my algorithm will not process them in real time.

  5. So I decided to use the continuous method for measuring the signal. This works great but only for a sort period of time. After a while I receive a message saying that “you are attempting to read data that no longer exist, try increasing the buffer…..”

  6. I believe that if I increase the buffer then I am delaying the signal and this will result again in no real time data processing from my algorithm.

 

In conclusion: My algorithm process data sample by sample. What is the best setting to use in order to measure and send the signal to my algorithm in real time and point by point (sample by sample) and not as a group of 1000 samples?

 I have attached both programms.

 

Thanks in advance.

0 Kudos
Message 1 of 3
(2,905 Views)
Both continuous and N Samples are designed to return an array of measurements. Using continuous and a single sample will return the error you have. The alternative is to use on-demand sampling but only if you don't care about the time between samples. I'm assuming that you are using LabVIEW and the simplest thing would be to just put your algorithm inside a for loop. If you had tested the algorithm by reading the lvm file line by line, it would have been more more efficient to read the entire file at once into an array and index each line automatically with the for loop.
Message 2 of 3
(2,897 Views)


Kalitexnis

What Dennis has posted is some good advice for data acquisition. It seems that the best method for you to apply would be to use Point by Point acquisition as Dennis mentioned. This method transfers a single point from the device to LabVIEW memory upon each read to the device. It seems that this is the methodology which you are trying to achieve. But this method does greatly increase the CPU overhead and so, depending on the specifications of your PC, could affect your system performance.

I have included a couple of links below to out knowledgebase, which provide some detailed articles on this type of acquisition. You can also find a good example VI by going to Help>>Find Examples>>hardware Input & Output>>DaqMX>>Analog Measurements>>Voltage>>Cont Acq&Graph Voltage-Single Point Optimization.

http://zone.ni.com/devzone/cda/epd/p/id/4791

http://zone.ni.com/devzone/cda/tut/p/id/4780

Hope this helps,

Best wishes

Rob





Rob L

NI Applications Engineer

UK & Ireland


It only takes a click to rate this message 😉
0 Kudos
Message 3 of 3
(2,877 Views)