09-24-2018 03:48 AM
Consider the following demo (saved as LV2016 snippet):
When using the cluster element, the array returned by Get Cluster Information.vi contains the proper data type per element, but the values are reset to the default values (ie. 0 and "" respectively).
When reading the variant attributes, the values are present.
How can the values be extracted from the cluster?
Tested with 32 bit LV 2016, LV 2017 and LV 2018 on Windows 10 x64.
KR, Benjamin
Solved! Go to Solution.
09-24-2018 07:10 AM
Hopefully this sheds some light on the subject matter? It doesn't help with the question itself, but does suggest a workaround. (Part of this discussion.)
09-24-2018 07:18 AM
It's not a bug, probably even a feature. Only the types are returned, probably to avoid data copies, when only the type is of interest.
Use Data To Variant on the cluster, convert the cluster to an array of variants.
09-24-2018 08:39 AM
Thanks, did not expect it to be that simple ...
@wiebe@CARYA : seems plausible.
-Benjamin
09-24-2018 01:11 PM
@stbe wrote:
Thanks, did not expect it to be that simple ...
@wiebe@CARYA : seems plausible.
-Benjamin
It was a voyage of discovery for myself, as well.
12-12-2019 02:41 AM
@billko wrote:
@stbe wrote:
Thanks, did not expect it to be that simple ...
@wiebe@CARYA : seems plausible.
-Benjamin
It was a voyage of discovery for myself, as well.
Putting back data in arrays\clusters is even harder. Especially if you want to preserve the original names of the variant elements. IIRC, flattening is required.