LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

can i use references to trigger events for objects?

Hi,

 

I have about thirty front panel buttopn controls on my user interface. They are all very spread out so I cannot put them all into a cluster. I have created a reference for each one and put them into an array. Each one of the buttons when pressed I want to trigger the exact same event on an event structure, but dont want to have to create 30 duplicate event cases for each button? any ideas how I can group them so that they trigger the same case?

 

regards

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

Hi Develop-i...,

use dynamic event registration. Connect your array of control references to the "Register For Events" node and the resulting "Event Registration Refnum" to your Event Structure, there you can then select your user event.

 

Mike 

Message Edited by MikeS81 on 08-26-2008 03:06 PM
0 Kudos
Message 2 of 6
(3,615 Views)

Mike is right, dynamic events are the way to go.

 

See here I wrote a little nugget on this topic.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 3 of 6
(3,609 Views)
cool. really appreciate the quick response there. knew it should be doable, have got it all working now. only one thing im struggling at, how do you go about labelling the dynamic event to a title of your choice?
0 Kudos
Message 4 of 6
(3,596 Views)

Hi Develop-i...,

maybe there is another way, but this also works.

 

Mike 

Message 5 of 6
(3,593 Views)

Mike is right, the label of the event is taken from the label of the wire, typecasting this gives you the ability to rename.

Here's the code for anyone interested:

 

 

Ton

Message Edited by TonP on 08-26-2008 05:48 PM
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 6 of 6
(3,581 Views)