fuzzycontrolfreak Posted April 23, 2008 Report Share Posted April 23, 2008 Hello there, I searched LAVA for a similar situation, but found nothing. I am acquiring a signal at a rate of 100S/s, and would like to fill the samples into a 1D array. I know how to do this using a for loop, with number of iterations being assigned as the size of the array. The problem now, however, is that I want the array to recieve data continuously inside a while loop, until i trigger it to stop. It doesn't bother me if the array has to be of fixed dimension, acting as a FIFO buffer, i.e it looses the earliest elements in case of overflow. Could anyone help me with this one. I use LabView 8.0. Thankyou very much... Quote Link to comment
hfettig Posted April 23, 2008 Report Share Posted April 23, 2008 Did you know that you can auto-index an output tunnel of a while loop to create an array the same way you can auto-index and output tunnel of a for loop? This is the default behaviour for for loops but not for while loops. In the while loop you can turn this behaviour on by right-clicking on you output tunnel and selecting 'enable auto-indexing'. Quote Link to comment
Götz Becker Posted April 23, 2008 Report Share Posted April 23, 2008 Hi, here is a simple ring buffer. Perhaps this is what you look for. Quote Link to comment
fuzzycontrolfreak Posted April 23, 2008 Author Report Share Posted April 23, 2008 Thankyou very much, I am really very grateful for your prompt responses, they were very helpful. Quote Link to comment
mross Posted April 23, 2008 Report Share Posted April 23, 2008 QUOTE (fuzzycontrolfreak @ Apr 22 2008, 01:23 PM) Hello there,I searched LAVA for a similar situation, but found nothing. I am acquiring a signal at a rate of 100S/s, and would like to fill the samples into a 1D array. I know how to do this using a for loop, with number of iterations being assigned as the size of the array. The problem now, however, is that I want the array to recieve data continuously inside a while loop, until i trigger it to stop. It doesn't bother me if the array has to be of fixed dimension, acting as a FIFO buffer, i.e it looses the earliest elements in case of overflow. Could anyone help me with this one. I use LabView 8.0. Thankyou very much... I think you just need to use a different kind of acquisition. (You should show us your code to get the best answer.) I am not at a computer where I can look at the examples so I have to tell what to try to do. Please forgive me if I leave something out. You want a continuous data acquisition, you want a finite number of scans (N-Scans), you want pretrigger function. When you run this type of VI, the DAQ board is set up and set in motion. It is constantly filling a buffer of the size you define. When you hit the stop trigger it simply reports the last buffer of data - whatever amount you told it. There is no limitation to only one channel and 1D array output. You can monitor several channels and get back the data from them all in a 2D array. There is absolutely no need for you to concern yourself with for or while loops at all. You can probably set up and test this sort of acquisition using MAX (Measurement and Acquisition eXplorer), and that is what you should always do - use MAX to get the acquisition working properly in the test panels. Then create that task and use it. Again, I apologize for the lack of detail, but I was given this WIN XP x64 machine to use and there are no drivers for this OS so I can't even load MAX on it. Mike Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.