WMassey Posted January 31, 2006 Report Share Posted January 31, 2006 I know how to programmatically get references to controls/indicators on the front panel but is it also possible to (recursively) get references to the controls within a cluster control on the front panel? Nevermind. I just found the answer. If you know that a front panel object is a cluster then it is possible to typecast its generic front panel reference (if it is generic) to a specific cluster reference and then use a cluster-specific property to get the cluster members. Quote Link to comment
David Wisti Posted January 31, 2006 Report Share Posted January 31, 2006 Here is a vi that will get all the control references from a cluster. This vi requires OpenG toolkit and Labview 7.0. Download File:post-319-1138726604.vi Quote Link to comment
yonatan.tidhar Posted January 31, 2006 Report Share Posted January 31, 2006 This is my non-recursive solution its return ref to all the the text ref at the FP you can modify it. :beer: Download File:post-2756-1138734963.llb Quote Link to comment
WMassey Posted January 31, 2006 Author Report Share Posted January 31, 2006 Thanks guys for the replys. I discovered that I needed this capability when the toolbox VI that I use to make hidden front panel controls appear didn't work on items within a cluster and no matter how hard I looked at the property node off the array of generic front panel references, I couldn't find a "cluster contents" reference. It occured to me shortly after I had asked the question to cast the generic reference to a cluster-specific reference and when I did that then I could find the references to the controls within the cluster. FWIW, I've attached the aforementioned toolbox VI (lv 7.1.1) for which I needed this. Download File:post-2800-1138743533.zip 1 Quote Link to comment
Mike Ashe Posted January 31, 2006 Report Share Posted January 31, 2006 Reminds me that a simple security technique we used several years ago is no longer valid. Back in the days of attribute nodes, before property nodes you had to popup on the individual control in a cluster on the front panel to create an attribute node. We would put a text control in a cluster, set a password in it as default, make an attribute, turn the control invisible (actually hide) and then delete the attribute node off the diagram. There was now no way to make it visible again. Unless someone knew it was there and where to look you'd never find it. We used this both as a simple password storage and also as a way to "watermark" our work sometimes. Obviously obsolete now. Quote Link to comment
WMassey Posted February 10, 2006 Author Report Share Posted February 10, 2006 This concept of showing/hiding front panel controls was beaten around more on InfoLabview here and, IMHO, a fairly nifty tool fell out of it all. If you add the VI to your LabVIEW projects folder (C:\Program Files\National Instruments\LabVIEW 7.1\project) then, after you restart LabVIEW, under the "Tools" menu option of some VI that is being edited is a choice to show & hide the front panel controls/indicators of the VI. Anyway the latest iteration of the tool (at the time of this writing) can be found here if you are interested. Quote Link to comment
Affirmative Posted July 29 Report Share Posted July 29 Here's an example following the type casting realization above from WMassey that I used, which gets all cluster component control and non-cluster control references. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.