LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Variant to Data Object Class

Solved!
Go to solution

The "Variant to Data" has that "Type" is a required input, according to the help documentation.

 

However, I can do a variant to data without using the type when the variant is an object and a Class Method is attached. Is this expected behaviour?

 

Also attached is a screen shot. The top loop used to have a "blue wire" method, which then became a child of the "brown wire" method. Since there is no type, the blue wire seems to have retained it's last colours. By duplicating the code, the new isntance has the correct colour. Both loops provide the same output,

0 Kudos
Message 1 of 5
(3,461 Views)

Hi Richard,

 

Would it be possible to attache an example code where that occurs?

 

Regards

Art
Applications Engineer
National Instruments
0 Kudos
Message 2 of 5
(3,393 Views)
Solution
Accepted by Richard_Ha

@Richard_Ha wrote:

The "Variant to Data" has that "Type" is a required input, according to the help documentation.


The documentation is no longer correct. I guess at some point someone thought it was a good idea to let the function be able to infer the data from the output if nothing is wired to the type input, but then forgot to update the help image.

 

I don't remember doing this with classes (or, at the very least, I hardly ever rely on this behavior, because I prefer explicitly wiring the type), but I could certainly imagine where this would function in an unexpected way. Unlike other types, classes have a dynamic element to the data type, which is certainly more of an incentive to make sure you wire in the correct class.


___________________
Try to take over the world!
Message 3 of 5
(3,382 Views)

So long as this is expected behavior that's ok. I didn't want to be relying on a bug that was going to be fixed. The text help and image should both be updated to reflect this.

 

It looks as though the wire "type" wasn't updated which was why I was getting the old colouring. By removing and reinserting the wire it fixed this issue.

0 Kudos
Message 4 of 5
(3,377 Views)

Over on LAVA people actually thought this was a bug (myself included).

 

https://lavag.org/topic/16197-magical-variant-to-data-or-bug/

 

AQ from LabVIEW R&D came and commented on this rarely seen feature.  Of course since then I've been able to implement something similar with an XNode that looks up stream to set the data type of the output to match it.  This XNode is mentioned in that thread.

0 Kudos
Message 5 of 5
(3,357 Views)