LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Possible bug: NI_Data Type.lvlib:Get Cluster Information.vi

Solved!
Go to solution

Consider the following demo (saved as LV2016 snippet):

 

parsing cluster.png

 

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).

probe.png

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

_________________________
CLA
0 Kudos
Message 1 of 6
(2,462 Views)
Solution
Accepted by topic author stbe

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.)

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 6
(2,438 Views)

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.

Message 3 of 6
(2,436 Views)

Thanks, did not expect it to be that simple ...

 

@ : seems plausible.

 

-Benjamin

_________________________
CLA
0 Kudos
Message 4 of 6
(2,423 Views)

@stbe wrote:

Thanks, did not expect it to be that simple ...

 

@ : seems plausible.

 

-Benjamin


It was a voyage of discovery for myself, as well.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 6
(2,404 Views)

@billko wrote:

@stbe wrote:

Thanks, did not expect it to be that simple ...

 

@ : 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.

0 Kudos
Message 6 of 6
(2,075 Views)