User events for 120 buttons

This is a discussion on User events for 120 buttons within the labview forums in Programming Languages category; 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 ...

Go Back   Application Development Forum > Programming Languages > labview

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-15-2008, 05:10 PM
cutekittenkyti
Guest
 
Default 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 eventsI want to make 2one for all the run buttonsone for all the stop buttons any help would be nice
Reply With Quote
  #2  
Old 08-15-2008, 05:40 PM
altenbach
Guest
 
Default Re: User events for 120 buttons

Make an array of 60 run buttons and 60 stop buttons, then find the changed element&nbsp;by comparing&nbsp;the oldval and newval event terminals.&nbsp;<a href="http://forums.ni.com/ni/board/message?board.id=170&amp;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. &nbsp;&nbsp;(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
Reply With Quote
  #3  
Old 08-15-2008, 05:40 PM
Darren
Guest
 
Default Re: User events for 120 buttons

I would use a Dynamic Event that fired on the Value Change of any one of a group of controls.&nbsp; You could create two Dynamic events, and wire all the Run control references to one, and all the Stop control references to another.&nbsp; Here's a screenshot...when the event fires, you can get the control label to figure out which button was pressed:&nbsp;<img src="http://forums.ni.com/ni/attachments/ni/170/349722/1/dynamic_event.png" border="0"> &nbsp;Hope this helps,-D Message Edited by Darren on 08-15-2008 04:21 PM


dynamic_event.png:
http://forums.ni.com/ni/attachments/...amic_event.png
Reply With Quote
  #4  
Old 08-15-2008, 05:40 PM
ajf200
Guest
 
Default Re: User events for 120 buttons

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?&nbsp; You could then have a subVI filter which button was pressed and then pass that info on to your control subVI.
Reply With Quote
  #5  
Old 08-15-2008, 06:10 PM
altenbach
Guest
 
Default Re: User events for 120 buttons

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


60Buttons1Event.vi:
http://forums.ni.com/ni/attachments/...ttons1Event.vi
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 09:43 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.