05-18-2023 12:14 PM
Hi All,
I have a data acquisition device that gives me data as a string, I have parsed that string and converted it into a numeric value. The way to get data is to write a VISA buffer "R1" after which it returns a value. I have this inside of a while loop that continuously collects the data. I have the numeric values going out of the while loop in indexing mode, so it creates an array so I can log all the data. What I want to do is create a virtual button, that when hit, will store the current numeric value into an array. Each time I click the button a new element with the current numeric value will be added to the array.
I've tried to create a case structure loop and wired the button to it. Then I wired the numeric value to build array also tried insert into array. This just replaces the value of the element in the array to the current value. not add a new element.
Please help!
Solved! Go to Solution.
05-18-2023 12:24 PM - edited 05-18-2023 12:26 PM
we prefer a simplified version of your VI (or even a picture) over long ambiguous descriptions.
If you build an array at an autoindexing output tunnel of a while loop (not recommended in general because of memory thrashing!), the array data will only be available after the while loop ends. Dataflow 101! You could use a conditional indexing tunnel if you only want to get certain values, but again the array will only be available once the loop ends.
Easiest would be to conditionally build your array in an initialized shift register.
05-26-2023 07:38 AM
Shift Register! That was the answer, I had to learn more about it. Thank You.