ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

variant convertion

I am trying to read the value of a boolean control using a reference node.
I have no problems when the mechanical action of the control is a switch
because the data type remains a boolean(green wire). The problem is when
I change the mechanical action to a latch the data type becomes a variant
(purple wire) and I get a error. I can not figure out how to convert a variant
to a boolean. My question, is there a way to convert a variant to a boolean.
Thanks in advance.

Dean Houck
0 Kudos
Message 1 of 2
(3,039 Views)
To convert a varient to a Boolean you can use the "Varient to Data" node which
is found in the Communication>>ActiveX sub-palette. The value property of
a boolean appears to be an empty varient without any data or attributes,
however. You should ask NI about that one!

-Jim

"Dean Houck" wrote:
>>I am trying to read the value of a boolean control using a reference node.>I
have no problems when the mechanical action of the control is a switch>because
the data type remains a boolean(green wire). The problem is when>I change
the mechanical action to a latch the data type becomes a variant>(purple
wire) and I get a error. I can not figure out how to convert a variant>to
a boolean. My question, is there a way to convert a variant to a boolean.>Thanks

in advance.>>Dean Houck
0 Kudos
Message 2 of 2
(3,039 Views)