LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

programatically updating a cluster in a cluster

I have a cluster that contains several arrays and a cluster of controls.  I am trying to create a method for a user to select one of the controls in the inner cluster and update the value.  I am trying to populate a ring control with a list of the control names to allow selection of the desired control.  The select param sub VI allows selection of the arrays or cluster, but when I use this index to select the reference for the cluster, the following property node doesn't offer the choice of selecting the controls[] property for the cluster.  Is this possible?
Jim

LV 2020
Download All
0 Kudos
Message 1 of 9
(2,798 Views)
Hi!

First of all: To update a value, you don't really need to do it this way with references...you can simply unbundle your input cluster by name, select the right sub-cluster, change the value the way you like an add it again to the cluster. Assign this to a local variable of your input cluster...

To your question: It's not possible to get a controls-listing out of this because there are so much different ways to add elements to your cluster that it's possible there are no sub-clusters. But you can do it the way you can see in the sample attached below: you have to convert your class to a more specific class telling labview you have sub-clusters in your cluster control...

Hope this helps,

Christian

THINK G!! 😉
------------------------------------------------------------------------------------------------
Using LabView 2010 and 2011 on Mac and Win
Programming in Microsoft Visual C++ (Win), XCode (Mac)
0 Kudos
Message 2 of 9
(2,783 Views)
The poster's VIs are in 7.1, so posting an example in 8.5 isn't going to do them any good, especially since their signature indicates they only go up to 8.0. Smiley Wink

Using unbundling/bundling by name and local variables does not seem practical as it requires a large case structure. Before we start saying what we can or cannot do, let's try to clarify the problem a bit more... To OP: In the VIs that you posted the initial list of string for the menu ring seemed to imply that you were trying to get the names of the individual elements of the SummaryDataCluster. When running the "cluster" VI, however, it only pulls out the first-level elements of the cluster. What are you trying to populate the menu ring with? Also, what are you presenting the user with in terms of user interface to allow changing the parameter?
0 Kudos
Message 3 of 9
(2,773 Views)
smercurio, I think that you accurately see the objective.  My goal is to allow the operator to select one of the controls in SummaryDataCluster in the menu ring, and then be able to update just that control.  The SelectParameter VI was a quick attempt to provide the UI for the control selection.  Either an addition to it or an additional VI could be used for new data.
Jim

LV 2020
0 Kudos
Message 4 of 9
(2,765 Views)
You might want to look at the vcluster library from the "OpenG LabVIEW data tools". That allows dealing with cluster elements by name.

If you don't have OpenG here are some installation instructions.
http://forums.jkisoft.com/index.php?showtopic=233

Things can get complicated if you need to handle multiple data types, and more than one level in the hierarchy.
The variant probe on lavag is a good example of a very generalized read only version, but it requires LV 8.5.

I attached a quick prototype that should open on LV 8+ with the openg library. Be aware it's lacking error checking.

Instead of a menu ring I would use a multicolumn listbox with the name in the first column and the value in the second, to make it easier to see what the current values are. If you wanted to get extra fancy you could try to use Type Sensitive Popups from lavag.
Message 5 of 9
(2,751 Views)
Matt,
I do have the OpenG toolkit, but have never looked under the hood of the data tools.  Looks promising.  I'll let you know how it works out.  Thank you.
Jim

LV 2020
0 Kudos
Message 6 of 9
(2,732 Views)
I love this place and these peeps!!!

Matt,
That was beautiful.  Thank you for helping me learn the tools in my toolbox.  That one was definitely worth more than 5*****!
Jim

LV 2020
0 Kudos
Message 7 of 9
(2,727 Views)

In my Save/Restore Nugget I talk about every possible variation of interacting with clusters. The included code (in that Nugget) illustrates many techniques. Not all of what I illustrated in that Nugget is required to do what you are asking. Most of what I showed ther can be "dumbed-down" and used.

Note: As of LV 8.0 it is now possible to recursive calls like (A calls B that calls A that calls B). So prior to LV 8.0 cluster that are clusters of arrays of cluster of arrays... those examples will not work

Just rying to help,

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 8 of 9
(2,707 Views)
Thank you Ben.  I've added that link to my "card catalog".  Very good nugget!


Message Edited by lmtis on 07-17-2008 11:12 AM
Jim

LV 2020
0 Kudos
Message 9 of 9
(2,683 Views)