LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

event structure

Hello
I 'm programming with LabView 7.0 and I use event strucutre. I've got few buttons with similar actions. I want to know how can I detect wich button has been pressed. It will allow me not to multiply cases in the event structure.

Thanks for your help.

Benoit
0 Kudos
Message 1 of 7
(3,156 Views)
Hi,

On the left of your event structure there are a few parameters that you get from it.
One of them is CtlRef, witch is a reference to the control that triggered the event.
You can connect to it a property node or event nodes to do whatever you want to do with the control - know it's name, it's value, ...

Hope this helps,
Paulo
Message 2 of 7
(3,141 Views)
Hi
thanks for your answer
but I don't understand : I've got 3 buttons and I added an indicator on this CtlRef. I don't see any difference when I use one or one other button.... How can I see witch button has been cliqued with this component ?


Thanks for your help

Benoit
0 Kudos
Message 3 of 7
(3,119 Views)
Hi

I'd suggest you to use the producer consumer pattern.

So each time one of those buttons is clicked, you produce the same element (usually this means enqueueing something). The consumer then start always the same action.
To see which button was pressed, you can write a numerical constant, depending on the case of the event-structure to an indicator. In the consumer you then will be able to read the value and decide what to do exactly.

Another way is to wire the control refnum to a property-node - so you can read the properties of this button.

Hope this helps.

Thomas

Message Edited by becktho on 06-17-2005 11:23 AM

Message Edited by becktho on 06-17-2005 11:24 AM

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 4 of 7
(3,110 Views)
Hello bapoyet,

i hope this example can help you.

Greets,
Marko
0 Kudos
Message 5 of 7
(3,105 Views)
Or, for a variation, this one


P.M.
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



Message 6 of 7
(3,094 Views)
Oop, sent it and then saw that you are using 7.0, try this one.

P.M.
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



Message 7 of 7
(3,092 Views)