01-03-2011 02:44 PM
Hi, I want to feed numbers into an array but its only using the first element. In my vi users can enter a number and this number needs to be then stored in an array. Any help would be welcome. Thanks
01-03-2011 02:50 PM
Post your VI so we can see what you are doing and recommend a better way.
01-03-2011 03:04 PM - edited 01-03-2011 03:04 PM
I am not familiar with the term "feeding" with respect to arrays. Please explain. 😄
To append an element to an existing array, use "build array". To replace an existing array element with a different value, use "replace array subset". To insert an element into an existing array, thus growing the array by one, use "insert into array".
Make sure to keep the array in a shift register or feedback node to retain the modified array between iterations.
01-03-2011 03:16 PM
currently I just have a random number generator thats wired to a build array, wired to an array but that only displays the current number.
01-03-2011 03:18 PM - edited 01-03-2011 03:21 PM
01-03-2011 03:26 PM
What is that array function you're using? Im using labview 9 that makes a difference.
01-03-2011 03:30 PM
01-03-2011 04:06 PM
it works! thank you, are there other ways that labview allows you to keep adding a number rather than an array, for example it continually adds the numbers input by the user?
01-03-2011 04:10 PM - edited 01-03-2011 04:12 PM
like this maybe?
Of course you would replace the random number with a control and use an event structure to spin the loop only if the input is changed by the user, for example.
01-03-2011 04:13 PM
i think so yes, for example if user a input 3, user b inputs 7 and user c inputs 8 the indicator would show 18 until i selected to clear the numbers?