LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Feeding numbers into an Array

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

Message 1 of 14
(5,532 Views)

Post your VI so we can see what you are doing and recommend a better way.

0 Kudos
Message 2 of 14
(5,526 Views)

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.

0 Kudos
Message 3 of 14
(5,518 Views)

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.

0 Kudos
Message 4 of 14
(5,510 Views)

As I said, the array needs to be in a shift register ...

 

Message 5 of 14
(5,504 Views)

What is that array function you're using? Im using labview 9 that makes a difference.

0 Kudos
Message 6 of 14
(5,498 Views)
0 Kudos
Message 7 of 14
(5,494 Views)

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?

0 Kudos
Message 8 of 14
(5,481 Views)

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.

0 Kudos
Message 9 of 14
(5,476 Views)

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?

0 Kudos
Message 10 of 14
(5,472 Views)