LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sample Integer and create array

Dear All,
I am looking to create an Array from a Integer value wich change continuously.
 
For example, I would like to sample(for ex: 10 times) this value every 100ms, and place each new sample in this array (and keeping all the samples values).
 
Regards.
 
 
0 Kudos
Message 1 of 6
(3,076 Views)

I would recommend putting the sampling inside of a while loop.
Also put a 'wait' inside the loop, attached to whatever time you want (ie 100ms for 10samples/sec)

Then wire the sample to "insert into array" whatever order you want (oldest to newest or visa versa).

Hope that helps,
Cory

Cory K
0 Kudos
Message 2 of 6
(3,074 Views)
How many samples do you want to store in the array at any one time.

I would recommend to initialise a fixed size array and rotate the array index +1 and replace the value at index 0. In that case LV doesn't need to call the memory manager all the time to increase your array.



Message Edited by andre.buurman@carya on 06-09-2008 06:26 PM

Message Edited by andre.buurman@carya on 06-09-2008 06:26 PM

Message Edited by andre.buurman@carya on 06-09-2008 06:28 PM
Regards,
André (CLA, CLED)
Message 3 of 6
(3,070 Views)

Thank you Both for your ideas, The sampling is working very well.Smiley Wink

I just would like to know if it is possible to keep the first sampled data in the first Row, and add the new ones in the following rows.

"last n elements last"

For the moment, I do it like this :

 

The problem is I am obliged to wait until the loop stop, I would like to add the new values in the last row continuously.

 

Regards

 

 

0 Kudos
Message 4 of 6
(3,039 Views)
Your attachment went wrong.

You can attach a picture below the edit window, then post and copy the link location of the attached picture then select edit post and insert a picture with the copied link location.
Regards,
André (CLA, CLED)
0 Kudos
Message 5 of 6
(3,029 Views)
Sorry Andre!
 
I hope, it's better now.
0 Kudos
Message 6 of 6
(3,024 Views)