04-15-2010 02:48 AM
Hello,
i want to develop an Array in which new elements could be added and the previous entered element remain in it.
Kindly solve it.
Thx
Solved! Go to Solution.
04-15-2010 03:02 AM
Hi Intelligent,
what have you already tried? Start with a loop and a shift register on it.
Mike
04-15-2010 06:44 AM
Intelligent, Did you find Mikes reply useful?
Guru
04-15-2010 08:56 AM
From LabVIEW, go to Help - Find Examples and search on "arrays". Look at Feedback Node - Build Array.vi
Thats a pretty good example meeting your requirement.
04-21-2010 12:52 AM
Thanks to all of you for replying.
I have tried all the given techniques, and they all generates array but my actual task is to record a value in an array such that the new value goes to the next index and the previous value remains there. And also it works in real time.
04-21-2010 01:17 AM
Check out Build Array.
/Y
04-21-2010 01:17 AM
04-21-2010 02:03 AM
Intelligent wrote:
but my actual task is to record a value in an array such that the new value goes to the next index and the previous value remains there.
This is how most arrays work. If you have followed any of the samples this is how they will work. Can you post what you have done so far because if you are not achieving the above then i would imagine your doing something fundementally wrong.
Do you know how large your array will be. If you do it is a good idea to initialise an array and then use the replace element vi. If you are using the build array in a loop then this can lead to memory issues.
Here is an example that was written for someone else with a slightly different problem but illustrates the point. The array is first initialised with 100 elements. In the loop the initialised array is updated with the new elements. In this example the array is used as a circular buffer which is not what i beleive you are after.
Rgs,
Lucither
04-21-2010 05:25 AM
My actual task is to record a certain value at certain condition. The value is recorded such that the latest value comes next to the previous.
With all the examples i successfully created the array but they last until the execution of the loop but what about when a new value comes and i have to place it in the array.
When using the Replace array function it requires an array with some values, the value corresponding to the index is replaced and when the index number is changed, the value now represents the new index value.
So i think that i may be able to make you ppl understand it.
04-21-2010 05:51 AM
Hi Intelligent,
you did not answer our questions nor uploaded an example VI...
All you want can be done by BuildArray functions!
"i successfully created the array but they last until the execution of the loop"
What do you mean by that??? Please attach your VI as asked before!