LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there an easier way to create and cluster large numbers of references than doing it one at a time?

Hey, I have an instrument for which there are a large number of controls on a panel. I want to have the controls reflect the state of the instrument at the time the panel opens. I was planning on creating a sub-vi, then clustering a reference to each of the controls, then having the sub-vi set each value.

The question is, is there a way to highlight say... 12 controls, make a reference, and cluster them all together without the tedious process of creating 12 references, then wiring 12 of them into a cluster?

Or perhaps I should be using something other than clusters entirely?

Thanks,
-Josh
0 Kudos
Message 1 of 3
(2,841 Views)
Writing values from control references is slow. Do not use it in high performance applications. Having said that, it sounds like you just want to do it once for initialization purposes, which is OK.

The answer is don't wire in a ton of clustered references. Just wire the a reference to the VI on which the controls live. You can get an array of references to all the front panel controls given the reference to the owning VI. You will need to "downcast" (to more specific type) for each particular data type, but that can be done inside the subVI. Note that the order of the reference array is the tabbing order of the controls on the front panel.

Dan Press
www.primetest.com
0 Kudos
Message 2 of 3
(2,841 Views)
Thanks for the tip. I learned Labview by writing an application (while working as an intern) and posting here when I got stuck, so I've missed a few things like that.

My new app. uses state machines and it's all nice and spiffy and efficient. Thanks for educating me eveyone. 🙂
0 Kudos
Message 3 of 3
(2,841 Views)