LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

store values in array

hi all!
 
i have problems with storing values in an array.
 
i have an ok button. when im pushing it, i like to store the first value at index 0 in the array. after pushing the button again, i want the second value to be stored at index 1 and so on.
 
can somebody help me?
that would be very nice 🙂
 
thanks a lot!
 
0 Kudos
Message 1 of 4
(8,089 Views)

It's easier to just change the code than explain everything, but I will make some points:

  1. The random number function only runs once, so all the numbers inside the loop will be the same.
  2. The key to what you wanted is the shift register, which allows keeping the same array between different iterations.
  3. A for loop is only relvant if you know in advance how many times you are going to run, not if you are waiting for user input.
  4. If you are using a for loop and you don't need to see the array inside the loop, you can simply wire the numeric value out of the loop and it will be built into a 1D array automatically.

To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here, here, here, here and here are a few you can start with and here are some tutorial videos. You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).


___________________
Try to take over the world!
Message 2 of 4
(8,076 Views)
thank you so much!
 
 
0 Kudos
Message 3 of 4
(8,043 Views)
0 Kudos
Message 4 of 4
(8,035 Views)