05-24-2020 03:07 AM - edited 05-24-2020 03:19 AM
@LucianM wrote:
Get Cluster Information.vi returns an array of variants each containing the elements type and not the values. You need to store the flatten string form of the original data as well to be able to convert it back:
Thanks! That makes sense.
05-24-2020 03:13 AM - edited 05-24-2020 03:19 AM
@billko wrote:
@pablo.doc wrote:
So I've found a workaround. It turns out you can convert the cluster into an array of variants first and this works, although I find it a bit inelegant. I'm still unsure of what was wrong with my original thinking.
You are wrapping your data within a cluster. You need to decode it the same way:
Edit:
Oops, I see you wanted it as an array. Forget the FOR loop.
That, unfortunately, requires knowing the cluster, so won't be able to solve for a generic cluster which is what I was after; it kind of misses the point of using the variant data type.
Perhaps I should have rephrased my question slightly. In any case, using the 'get cluster information' gives the cluster type, which you can then use to convert the data back into something usable.
05-24-2020 10:51 AM
You don't need 'get cluster information' at all. Just use 'variant to data' with an array of variants as the type.