LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help with Cluster of Buttons displaying a message to which button is being pressed.

Solved!
Go to solution

Create a VI with a cluster of six buttons labeled Option1…Option6. When executing, the VI should wait for the user to press one of the buttons. When a button is pressed, use the Display Message To User Express VI to indicate which option was selected. Repeat this process until the user presses the Stop button. The parameters of the problem needs me to use a while loop, case structure, a shift register and search 1d array. I'm just having trouble setting up my case structures and how to get the search 1d array to work with the cluster to find which button was pressed. I've attached a picture of my VI and also a VI I made without the cluster that does what I want the Cluster VI to do which is to recognize the button being pressed and bring up a prompt.

Download All
0 Kudos
Message 1 of 5
(4,057 Views)
Solution
Accepted by topic author JDTitteR
Sorry, but except for the Stop button, little of that code is correct. You need the cluster inside the whole loop. Otherwise, all that you read is the initial condition. After converting to an array of Booleans, it is silly to convert back to a cluster and then unbundle.
0 Kudos
Message 2 of 5
(4,036 Views)

Okay so i moved the cluster into the while loop and wired a boolean true constant to the element of the search 1d array and now I can at least get the prompt for button 1 to display, but when I press the other buttons which I have set up the same way as button 1 I get no prompts so how can I get it to recognize the other buttons. Am I implementing the shift register incorrectly? 

0 Kudos
Message 3 of 5
(4,026 Views)

Why are you even using a shift register?

 

Get rid of the shift register.  Just wire the integer wire fromt he Search 1D array directly to your case structure.

0 Kudos
Message 4 of 5
(4,021 Views)

Okay I figured out how to make this work I made the numeric constant wired to the shift register to be -1 and made a default case that checks but doesn't have any output messages. Thanks.

0 Kudos
Message 5 of 5
(4,001 Views)