LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

event structure triggered by multiple events

I have an events structure where one case needs to handle a button press from any of three controls from the front panel.  When i press any of the three buttons, the program is going into the correct event case.  However, once i am in the correct case, i need to know which button was pressed so that i can perform slightly different tasks?  Any ideas?

Kind Regards,
Bryan
0 Kudos
Message 1 of 14
(6,088 Views)
Part of the event data for each event is a reference to the object on which the event was triggered.  You can use this to tell which button the user interacted with.  Alternatively, if you're watching for Value Change, I suppose you can check the value of the buttons to figure out which one changed.

J

Jason King
LabVIEW R&D
National Instruments
0 Kudos
Message 2 of 14
(6,073 Views)
Use the reference to read the label or something. See attached VI (LV 7.1).

Message 3 of 14
(6,071 Views)
There are many possibilities. Attached is one simple example (LabVIEW 7.0) that does not use control references.
 
(If only one of the buttons can be active at any time. you could also use a single radio button as a control)
Message 4 of 14
(6,063 Views)

Often when you want to trigger an event from multiple locations it is easiest to chain events.  That is to create an new event (USER EVENT) which takes the needed data (A cluster) that also includes the case or source of the event.  here you can handle the event in one location but fire it form multiple sources. 

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 5 of 14
(6,047 Views)
Thanks for those.  I used the build array approach in the end.  I am somewhat weak on the property nodes so i found those the most elegant.  Are there any good resources or examples which explain property nodes?  Many thanks, Bryan
0 Kudos
Message 6 of 14
(6,025 Views)
Paul, are you saying that one should bind the events and needed data into a cluster and wire that to the appropriate events case.  Once in the events case, then "chain" the event by parsing out the needed reference information from the cluster? Bryan
0 Kudos
Message 7 of 14
(6,019 Views)
Well, the property nodes come in handy on many occasions. For example, you can use property nodes to disable (and grey out) controls, to show/hide controls or to populate ring or listbox controls in runtime. In the example finder you'll find examples using property nodes.
To start, just right-click a control, select Create > Property Node and see what properties are available. With the context help enabled you'll see a short explanation of the selected property and possible values for it.

0 Kudos
Message 8 of 14
(6,016 Views)

Attached is a crude chained event.  The advantage of such an architecture is that you have a common event which can be triggered in from multiple places without forcing all sources to be treated as one event.  This also allows you to unrgistter each source independently and makes the code more flexable.  Just my opinion, I could be wrong.

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 9 of 14
(6,006 Views)
Thanks for the chained events example.  That really helps me understand what you were talking about...it is a really nice solution.
0 Kudos
Message 10 of 14
(5,978 Views)