LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get Cluster Information VI preserves data?

I found the data typo parsing vis in labview 2015 and thought these could be useful.

 

Specifically the "Get Cluster Info VI"  Takes a cluster and returns an array of variants, one for each element in the cluster.  This is great except for the fact that all data is returned with the default value.  Is this how the function is intended to run?  Or is this a bug.  Unclear to me.  I can not see why I would not want to preserve the data with the type.  Is there a work around to preserve the data with the type.

 

 

 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 1 of 10
(4,665 Views)

sorry should have read data type parsing.  'typo' how ironic.

 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 10
(4,659 Views)

Get Cluster Info is supposed to work exactly that way if you need a function that converts a cluster to a variant with data and type preserved it is called "To Variant"


"Should be" isn't "Is" -Jay
Message 3 of 10
(4,634 Views)

To Variant converts the cluster to a single variant.  I was trying to parse a cluster and preserve the data into the input.  I was surprised to know the data is thrown away.  To variant returns a single variant and no parsing.  I do not see why data is thrown out by the parse function.  In my mind it is less useful if data is lost.

 

 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 4 of 10
(4,610 Views)

Does anyone has an idea for access the cluster data in the variant? I'm on the same point of problem. I have a variant (which includes a cluster) and would loop trough the cluster and convert the value and name in a string...

I would use a variant to handling different cluster 'types' with one VI.

0 Kudos
Message 5 of 10
(4,463 Views)

Start up VIPM and install the OpenG LabVIEW Data library. And the OpenG Variant Configuration File Library makes use of this at its core to allow to easily write any type (including complex clusters) to an ini file and retrieve it later on.

Rolf Kalbermatter
My Blog
0 Kudos
Message 6 of 10
(4,461 Views)

@silvan.murer wrote:

Does anyone has an idea for access the cluster data in the variant? I'm on the same point of problem. I have a variant (which includes a cluster) and would loop trough the cluster and convert the value and name in a string...

I would use a variant to handling different cluster 'types' with one VI.


This recent discussion might help you:

https://forums.ni.com/t5/LabVIEW/Typedef-value-from-ctl-file-Front-panel-Control-Reference/m-p/36240...

0 Kudos
Message 7 of 10
(4,456 Views)

Nice! OpenG was the right hint! With the OpenG LabVIEW Data I could do what I want...

Many thanks!

0 Kudos
Message 8 of 10
(4,432 Views)

This also works, but causes some messy wiring:

 

Cluster to Array of VData.png

I wish NI would add this as built-in functionality for this primitive.

Message 9 of 10
(4,040 Views)

Use Variant to Data and convert a Cluster to an Array of Variants and you'll have 1 item with data per cluster item.

Cluster to Variant.png

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 10 of 10
(4,034 Views)