LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a Capture Button.

Solved!
Go to solution

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!

0 Kudos
Message 1 of 3
(609 Views)
Solution
Accepted by topic author YPWORK

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.

Message 2 of 3
(603 Views)

Shift Register! That was the answer, I had to learn more about it. Thank You. 

0 Kudos
Message 3 of 3
(512 Views)