11-04-2015 11:10 AM
Oh wow great trick indeed Sam_Sharp! Thanks alot!
That will definatly cleanup a lot the code as actually we have a long list of event structure case.
Thanks again that was actually another aspect I add to improve on the code.
You answered an unasked question!
11-04-2015 11:39 AM
That is a nice example Sam, and I will probably make use of it soon. Just curious, is there some way to make it so that the corresponding action does not rely on the control label?
I am just thinking sometimes I change labels like if I originally think I just need a "Voltage" indicator, and later decide I want "Avg Voltage" and "Instantaneous Voltage".
11-04-2015 12:01 PM - edited 11-04-2015 12:02 PM
There is a property of each front panel control called "UID". This value doesn't change once you've created the control. Each element in a cluster also has its own UID.
The UIDs aren't very human readable as much as the labels are, but they're consistant.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
11-04-2015 12:13 PM
In the past couple of years, I wrote something very similar to Ben's GUI manager using LVOOP. That method is very flexible.
To update my controls, I used control indexes. That requires some forethought and supporting infrastructure, though. I traverse the UI at launch, gather and cache all refs and control indexes, and then conditionally access and update them as needed. It works beautifully and updates very efficiently.
Maybe this will be helpful? Maybe not.
11-04-2015 12:57 PM
This is a very good thread. I'll have to remember this the next time I have a bunch of controls to manage.
11-04-2015 01:05 PM
Hi Mr_Jim, when you say you used LVOOP for the GUI manager do you mean your references are stored in a LabVIEW class?
Can you do a very quick and simple example showing it?
I am also learning LVOOP as I learn more advance functionality of LabVIEW and I am very interested in hearing more about OOP.
11-04-2015 01:18 PM
Hi Lawats,
> when you say you used LVOOP for the GUI manager do you mean your references are stored in a LabVIEW class?
Yes. What I did was make a UI manager class that is generic to any UI:
Now, all this being said, this can have a "black magic" feel to it because it bypasses dataflow. It's very efficient, though, provided you handle your references with care.
If you encapsulate everything inside a UI manager class, though, it makes usage pretty simple.
11-04-2015 02:08 PM
Hi Mr._Jim,
I can't seem to get a hold on Set Control Values by Index Function . I'm using LabVIEW 2011, can this limited to a more recent version?
11-04-2015 02:21 PM - edited 11-04-2015 02:23 PM
Looks like you are correct, your 2011 LV won't include this VI unfortunately.
Here's the palette documentation for 2011.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
11-04-2015 02:38 PM
Ah, yes. Control indexes are a fairly recent (and not well-known) feature.
Sorry about that...
Well, you could still cache control references, anyway.