LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Connecting (or not) the "type" input of the "Variant To Data" function?

Solved!
Go to solution

I have noticed (again I suppose) that when I connect a "Variant to Data" output to a VI's connector or an indicator of known type, the wire automatically adopts the correct type. Does this mean I don't need to connect a wire to the "Type" input of the "Variant to Data" output?

0 Kudos
Message 1 of 5
(2,665 Views)

Correct.  It doesn't always work, though - if you get a broken wire, you probably need to wire the type input.

Message 2 of 5
(2,655 Views)

This is correct. If the wire isn't broken, you're fine. However, this only works if the function is connected directly to an indicator. If the wire has to pass through a case structure or loop boundary, this won't work.

Jarrod S.
National Instruments
Message 3 of 5
(2,629 Views)

OK. I have noticed that connecting to a "Value" Property node does not work either, very much in the same way that, if you connect a graph structure to a XY graph "Value" property node, it will result in a broken wire, unless you first connect the graph structure to the indicator. This apparently tells the indicator what kind of graph structure to expect. Then you can connect the graph structure to a "value" property node for that graph.

I am wondering why a "Value" property node cannot "tell" what type its indicator (or control) is. In the case of the graph indicator, that can make sense since I suppose the graph are "polymorphic" controls/indicators. But in the case of a scalar?

0 Kudos
Message 4 of 5
(2,627 Views)
Solution
Accepted by topic author X.

There are many similar situations where this shortcut does not work. For instance, wiring the Variant to Data function to a Bundle by Name node doesn't automatically select the conversion target type. I am guessing that the indicator case is a very specific optimization, and that this is not a generally available shortcut.

Jarrod S.
National Instruments
Message 5 of 5
(2,604 Views)