LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Push button which gives data: how to store it?

Solved!
Go to solution

Hi, I have a set of push buttons in LabVIEW, everyone gives me a decimal number which is holded at the end (press button X and its value is hold, when you press button Y the value changes with the new number)... I want to make a sequence of N elements (N is selectable) pressing the push buttons, storing the data of each button and its sequence according I selected in an array, matrix or the best method. Thank you!!

 

 


Carlos Ignacio Sarmiento
Electronic Engineer
(Ciudad Madero Technological Institute)
Laboratory of Bioelectronics, Biohospital Engineering Departament
National Institute of Neurology and Neurosurgery "Manuel Velasco Suárez" (Mexico City)
0 Kudos
Message 1 of 19
(3,195 Views)

You can start with an empty global array, and an Event Structure (http://www.ni.com/white-paper/3331/en).

 

Make the Event Structure activate every time you press a button (for example, add a case for "Boolean 1": Value Change), and append your value to the array.

Certified LabVIEW Developer
0 Kudos
Message 2 of 19
(3,191 Views)

I don't know what an "empty global array" is, but you should first simplify your logic. All you need is an array of booleans, an array of LEDs and an array of corresponding values. Here's a quick example.

 

You did not say how to determine the final array size. Of course you can sto the loop if the array size reaches a certain value.

 

 

0 Kudos
Message 3 of 19
(3,182 Views)

Sorry for being unclear; I meant an array that is initalized to be empty -- like what altenbach did with the shift register.

Certified LabVIEW Developer
0 Kudos
Message 4 of 19
(3,175 Views)
Solution
Accepted by topic author CISG

This should help.

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
0 Kudos
Message 5 of 19
(3,172 Views)

no I didn't say because it will be selectable, I don't know, a maximum of 150 or few less


Carlos Ignacio Sarmiento
Electronic Engineer
(Ciudad Madero Technological Institute)
Laboratory of Bioelectronics, Biohospital Engineering Departament
National Institute of Neurology and Neurosurgery "Manuel Velasco Suárez" (Mexico City)
0 Kudos
Message 6 of 19
(3,164 Views)

@CISG wrote:

no I didn't say because it will be selectable, I don't know, a maximum of 150 or few less


Selectable how? With a numeric control beforehand? End it by pressing the stop button?

0 Kudos
Message 7 of 19
(3,161 Views)

This last is the one solution I was looking for, thank you so much!!! 🙂


Carlos Ignacio Sarmiento
Electronic Engineer
(Ciudad Madero Technological Institute)
Laboratory of Bioelectronics, Biohospital Engineering Departament
National Institute of Neurology and Neurosurgery "Manuel Velasco Suárez" (Mexico City)
0 Kudos
Message 8 of 19
(3,160 Views)

It is not a scalable solution. WIth 8 buttons you would need 8 nearly identical event cases, with mostly duplicate code. Way too much work (expecially if you need to make modifications later). Also, since the element is always added to the end, a simple "build array" as in my example would suffice, then you don't need the second shift register. If you need to know the number of elements, a simple "array size" will do.

0 Kudos
Message 9 of 19
(3,156 Views)
yeah a numeric control is the idea for selection I had

Carlos Ignacio Sarmiento
Electronic Engineer
(Ciudad Madero Technological Institute)
Laboratory of Bioelectronics, Biohospital Engineering Departament
National Institute of Neurology and Neurosurgery "Manuel Velasco Suárez" (Mexico City)
0 Kudos
Message 10 of 19
(3,155 Views)