Fernandotid Posted September 20, 2005 Report Share Posted September 20, 2005 Hi people, I would like to share a little problem with Labview. I have a VI with a cluster which can be changed from the exterior (thanks to a connector). I would like to know if it is possible to change a single element of this cluster from another VI, without changing or putting the other values of the other elements in the cluster. Is it possible? Thanks in advance :headbang: Quote Link to comment
regisphilbin Posted September 20, 2005 Report Share Posted September 20, 2005 you can "unbunble" a cluster element, then , you can select which element(s) that you would like to update in the 2nd cluster (could have completely different cluster elements) by using "bundle" function. I took a snapshot of what I thought you were looking for. Quote Link to comment
m3nth Posted September 21, 2005 Report Share Posted September 21, 2005 Well, if "another VI" is a VI within your application, you can easily get a reference to the cluster and access the Controls[] property to get an array of references to each control in the property which you can check by label name usually (for loop + name comparison). That can get you the reference for a single control in your cluster which can be used to read or change the value. If "another VI" is a VI not within your application you can still get a reference by opening a VI reference and traversing the class tree, albeit slightly more complicated. It's basically the same as above though. I would look at some of the examples in the scripting forum on that note. Quote Link to comment
Sparc Posted September 27, 2005 Report Share Posted September 27, 2005 To update a value of a cluster, don't do it via a reference. Unless you like slow and complicated code it is usually better just to pass the value of the cluster around. Use references to affect how the cluster looks or behaves. Unless you have a compelling reason, don't use references to just to update a value. If you've found that every time you change what the cluster holds that all your sub-vis break, you should turn your cluster into a type def. Sparc 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.