Prev: Reading controller data into LabVIEW through serial connections tocontrollers?
Next: Sell LabVIEW 8.6
From: cutekittenkyti on 15 Aug 2008 17:10 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 eventsI want to make 2one for all the run buttonsone for all the stop buttons any help would be nice
From: Darren on 15 Aug 2008 17:40 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: <img src="http://forums.ni.com/ni/attachments/ni/170/349722/1/dynamic_event.png" border="0"> Hope this helps,-D Message Edited by Darren on 08-15-2008 04:21 PM dynamic_event.png: http://forums.ni.com/ni/attachments/ni/170/349722/1/dynamic_event.png
From: altenbach on 15 Aug 2008 17:40 Make an array of 60 run buttons and 60 stop buttons, then find the changed element by comparing the oldval and newval event terminals. <a href="http://forums.ni.com/ni/board/message?board.id=170&message.id=349306#M349306" target="_blank">Here's</a> 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
From: ajf200 on 15 Aug 2008 17:40 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.
From: altenbach on 15 Aug 2008 18:10
Here's a quick draft on what I had in mind (LabVIEW 8.5.1). 60Buttons1Event.vi: http://forums.ni.com/ni/attachments/ni/170/349729/1/60Buttons1Event.vi |