LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I use the same event case for different controls dynamically

Solved!
Go to solution
OS: Linux 2.6.24-1-686 #1 SMP Sat Apr 19 00:37:55 UTC 2008 i686 GNU/Linux
LabVIEW: Version 8.2

I have a lot of (about 50) controls (numeric, boolean) on my front panel. If a "Value Change" event will be fired by any of them the same event case shall be executed. As I do not want to add all 50 controls to the same event case manually I am looking for a way to do it at run time. Additionally the VI is still under contruction, i.e. controls will be added and removed.

Thanks for any help here.

Regards,
Johannes
0 Kudos
Message 1 of 5
(3,145 Views)
Solution
Accepted by kremp@fti-en.com
Hi Johannes,
collect all your control references (you can use the FP property for it) and create a user event. Connect this user event to your event structure. Now you have one event case for all your controls. See the attached picture.

Mike
0 Kudos
Message 2 of 5
(3,141 Views)
Thanks Mike. Works as I needed it.

Last thing: I also use "Tab Controls". The controls placed on them are not taken by the your solution. I think I only need to parse the FP array "Controls[]" for "Tab Controls" references and add the correspondent arrays "Controls[]" of the "Tab Controls" to your solution, right?
0 Kudos
Message 3 of 5
(3,135 Views)
Hi Johannes,
yes, search for "Tab Controls", use the "to more generic class" function and go through all pages to get the controls on it. The other exception are clusters.
Mike


Message Edited by MikeS81 on 07-13-2008 10:20 AM
0 Kudos
Message 4 of 5
(3,131 Views)
Other exceptions: Individual booleans in radio button controls, numeric displays in graphs, ... I think there may be some others as well, but I do not recall at the moment. Any compound control may have nested parts with their own references.

If you want to change properties other than value, even something like a boolean gets complicated because it has a Caption and the Boolean Strings[4].

Lynn
0 Kudos
Message 5 of 5
(3,076 Views)