Jump to content

Continuously filling an array in a while loop!


Recommended Posts

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...

Link to comment

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'.

Link to comment

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

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.