LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

User events for 120 buttons

I am writing a program that has over 120 buttons. 60 of them are run buttons and 60 of them are stop buttons. Each pair of buttons controls a microcontroller with a specific address.

 

When I press a run button, I run the same subVI for all of them, with the only difference being the address

 

My question is, can I make a singe user event that detects whenever a run button is pushed that will also tell me which run button was actually pushed (to allow me to have the correct address for the microcontroller)

 

I DON'T want to make 120 different user events

I want to make 2

one for all the run buttons

one for all the stop buttons

 

any help would be nice

0 Kudos
Message 1 of 6
(3,216 Views)

Make an array of 60 run buttons and 60 stop buttons, then find the changed element by comparing the oldval and newval event terminals.

 

Here's a recent discussion using 2D arrays. Most likely you want to arrange your buttons in 2D for a better FP design.

 

 

(How about a single 2D array with booleans and use the buttons for both on and off?)

Message Edited by altenbach on 08-15-2008 02:22 PM
0 Kudos
Message 2 of 6
(3,205 Views)

I would use a Dynamic Event that fired on the Value Change of any one of a group of controls.  You could create two Dynamic events, and wire all the Run control references to one, and all the Stop control references to another.  Here's a screenshot...when the event fires, you can get the control label to figure out which button was pressed:

 

 

Hope this helps,

-D

Message Edited by Darren on 08-15-2008 04:21 PM
Message 3 of 6
(3,204 Views)
What about putting all of the Run buttons in one cluster, and all of the Stop buttons in another and have the events be On Value Change of the respective cluster?  You could then have a subVI filter which button was pressed and then pass that info on to your control subVI.
0 Kudos
Message 4 of 6
(3,200 Views)

Here's a quick draft on what I had in mind (LabVIEW 8.5.1).

 

 

 

 

0 Kudos
Message 5 of 6
(3,187 Views)

How about two buttons and an address control?  Set the address to the device to be turned on or off then press the single On or Off button.  You could use 120 indicators if you need to show the status of all the devices.

 

Lynn 

0 Kudos
Message 6 of 6
(3,078 Views)