From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

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
(4,848 Views)

Important: save your cluster as Type Def. control!

variant.png

0 Kudos
Message 2 of 4
(4,839 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
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 4
(4,824 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
(4,795 Views)