11-21-2012 08:09 PM
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!!
Solved! Go to Solution.
11-21-2012 08:23 PM - edited 11-21-2012 08:27 PM
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.
11-21-2012 08:50 PM
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.
11-21-2012 09:14 PM
11-21-2012 09:24 PM
This should help.
11-21-2012 09:51 PM
no I didn't say because it will be selectable, I don't know, a maximum of 150 or few less
11-21-2012 09:53 PM
@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?
11-21-2012 09:53 PM
This last is the one solution I was looking for, thank you so much!!! 🙂
11-21-2012 09:59 PM
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.
11-21-2012 09:59 PM