03-13-2017 03:35 PM
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.
03-13-2017 03:47 PM
sorry should have read data type parsing. 'typo' how ironic.
03-13-2017 04:58 PM - edited 03-13-2017 05:00 PM
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"
03-13-2017 08:50 PM
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.
05-17-2017 02:40 AM
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.
05-17-2017 02:51 AM
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.
05-17-2017 02:58 AM
@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:
05-17-2017 08:48 AM
Nice! OpenG was the right hint! With the OpenG LabVIEW Data I could do what I want...
Many thanks!
04-17-2018 08:23 AM
This also works, but causes some messy wiring:
I wish NI would add this as built-in functionality for this primitive.
04-17-2018 09:49 AM - edited 04-17-2018 09:53 AM
Use Variant to Data and convert a Cluster to an Array of Variants and you'll have 1 item with data per cluster item.
/Y