LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Variant to Cluster

Hello.

Im triing to do a typecast for this variant (content below as copy/pasted from a probe of my variant).:

 

'topic' -> "pupil"
'norm_pos' -> [2]
(430.396E-3, 726.106E-3)
'method' -> "2d c++"
'confidence' -> 858.839E-3
'timestamp' -> 717.154E+3
'id' -> 0
'ellipse' -> {[2]
, [2]
, 137.336E+0}
'diameter' -> 64.408E+0

 

I thought to create a cluster which contains the above variablenames (topic,nor_pos,...) and variabletypes (string, array of doubles, ...) and insert the variant as well as the type template (my cluster definition) to some function. I never did typecasts in labview and would need some help here which functions to use for that.

 

Thanks a lot!

0 Kudos
Message 1 of 4
(1,029 Views)

Important: save your cluster as Type Def. control!

variant.png

0 Kudos
Message 2 of 4
(1,020 Views)

That variant data looks more like variant attributes than a cluster the was cast to a variant.  Where is the variable coming from?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
0 Kudos
Message 3 of 4
(1,005 Views)

I'm attaching a Cluster that resembles the text you showed.  I took a few liberties with spelling (removing unneeded underscores) and capitalization.  I left "Ellipse" as a blank Cluster, as I couldn't figure out what this was supposed to be from your post (is it an array?  something else?  Don't know).  This has been saved as a TypeDef called "My Cluster.ctl" (on my PC) ...

My Cluster.png

Bob Schor

0 Kudos
Message 4 of 4
(976 Views)