06-01-2016 10:41 AM
Hello everybody,
my simplified scenario is this: I have N clusters, C1, C2, ... CN. They are different but all of them contain a double named D. I want to design a VI that takes in any of those clusters (cluster->variant first) and returns D. I tried to use the Get Variant Attribute with 'D' as name input, but that doesn't work. How can I achieve my goal?
Solved! Go to Solution.
06-01-2016 11:01 AM
HI m-ad,
There is a VI call Get Cluster Element by Name_ogtk.vi ib openg toolkit package which do that!
You can find the package on VIPM.
I made you a screenshot.
Regards
06-01-2016 01:16 PM
If you don't want to use toolkits, here is how you do it with primatives..
06-01-2016 01:25 PM
Better yet, here is the snippet, use this..
If you only care about your "D" label, then just code up the "D" selection in the case structure..
06-01-2016 01:27 PM
Where the reference is to "Cluster 2" is wrong.. I don't know why the snippet keeps creating that, replace it with a Reference to the Cluster control, then it will work
06-01-2016 03:13 PM
LabVIEW's built-in VI snippets always breaks references and event structures.
Use the Code Capture Tool and you won't have that problem.
06-05-2016 07:46 PM
While the marked solution (to use the excellent OpenG toolkit) is clearly my first choice, since someone else spoke about avoiding toolkits, I'll mention that more variant support is built in to the native LabVIEW distribution. You can also find a solution in the VIs under: <vi.lib>\Utility\Data Type, starting with "Get Cluster Information.vi".
And I'd say that the suggestions involving references to controls, and property nodes, are no solutions at all. None of what you're asking for needs to work with front panel references.
Dave