Popular Post DTaylor Posted March 15, 2017 Popular Post Report Share Posted March 15, 2017 (edited) Attached is a VI Package that will add LV-Control-Refs.xnode to your palette. This node, when dropped on the block diagram or double clicked, will update its output to a cluster of references to all controls in the VI. Controls in tabs show up as <Tab Control Name>:<Page Name>.Control Label. Nested tab controls with arbitrary depth are supported. You can bind the output of the node to an existing typedef by right-clicking on it. I've used this node for awhile, but the tab support was added very recently and was a significant change. I've also attached a scripting library I maintain that this XNode depends on. And source for the scripting library is here: https://github.com/erdosmiller/lv-scripting I wrote this node because several times I've found myself bundling nearly all the control references in a VI into a cluster. It requires LabVIEW 2015 or later. Let me know what you think! lv_scripting-0.7.0.6.vip Edited February 19, 2018 by DTaylor 5 Quote Link to comment
hooovahh Posted March 15, 2017 Report Share Posted March 15, 2017 Neat concept. One of those reuseable functions I've had for a while can get all references to controls on the FP given a VI reference, and the name of the control. This works alright, but the control references are of the control class and not the more specific class like String Control. I improved on this with an XNode that still does searching for controls based on their labels, but you can specify the control class to cast it to. Still in some cases I think I like yours better. If I needed to do an operation on all booleans I'd use mine since it returns an array of references, but yours is pretty damned simple. Quote Link to comment
iNeelex Posted July 3, 2017 Report Share Posted July 3, 2017 Hello to both of you. I have a old project where I need to extend the code and in my opinion I would like to rebuild everything fromnew scratch but I am not allowed to. My problem looks like this: So I searched for a neat solution to reduce all this reference crap in the begining. After I found this cool xnode of yours I thought I have a cool solution, but I isn't there a way to handover a textfile or something to the xnode which than will only get the control references according to a list of Labelnames from within this textfile? From specific controls like : Tab Control Add Button Infos Then the xnode only adds the reference of these specific Controls to its cluster? Peace, Neelex Quote Link to comment
DTaylor Posted July 5, 2017 Author Report Share Posted July 5, 2017 Neelex, You're right, there isn't a way to do what you're looking for as it is. I'm in the middle of a big project right now, but next time I have the chance I'll see if there's a nice way to get that kind of functionality in there (may not be 'til after summer). Quote Link to comment
smithd Posted July 6, 2017 Report Share Posted July 6, 2017 On 7/2/2017 at 11:53 PM, iNeelex said: So I searched for a neat solution to reduce all this reference crap in the begining. After I found this cool xnode of yours I thought I have a cool solution, but I isn't there a way to handover a textfile or something to the xnode which than will only get the control references according to a list of Labelnames from within this textfile? It looks like most of those references are identically named to the cluster in which they are stored. You can pretty easily use the data type parsing VIs to take each cluster, get all the element names out, then get all front panel control references and just match the strings. I'm not sure how you'd get the generic control reference back to the specific types in the cluster but I bet you could type cast or use ->tovariant->variant-to-data-> to accomplish it. Quote Link to comment
iNeelex Posted July 14, 2017 Report Share Posted July 14, 2017 Hey yo Tylor and smith, @Tylor: No problem if I get some time as well I will try this on my own, but this might be at the end of the year :D... @smith: Your right, I was already experimenting with the data type parsing VIs. But I wasn't able to create a completly dynamical functionallity to parse throughout all the ClusterOfReferences from my Project to create one single VariantClusterOfReferences. But I just parse through each TypeDef and bundle all in the end. Would be nicer to be able to handover the big typdef and get it out instead of go through every single typdef cluster and bundle each at the end together to the big one. 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.