Variant To / From Element Border Node

Owning Palette: Structures

Requires: Base Development System

Right-click the border of an In Place Element structure and select the Add Variant To / From Element option from the shortcut menu to place this border node on the In Place Element structure.

Details  

variant is the variant data you want to convert to the LabVIEW data type specified in type.
type is the LabVIEW data type to which you want to convert the variant data. type can be any data type. However, this function returns an error if LabVIEW cannot convert the data wired to variant to the data type you wire to this input. If the data is integers, you can coerce the data to another numeric representation, such as an extended-precision, floating-point number.
variant is the resulting variant data.
error out contains error information. This output provides standard error out functionality.

This border node has error out terminals on both sides of the structure. The error output on the left returns the actual error and the error output on the right duplicates the error from the left. You need to wire only one of the error out terminals because they have the same error output.

Variant To / From Element Details

Use this border node to perform operations on one or more variant data elements and replace the variant data with the new data type in the same location in memory. Each variant data element you retrieve with the border node on the left side of the structure must be converted back to a variant with the border node on the right side of the structure. This border node allows the LabVIEW compiler to avoid storing a complete value copy of the variant and variant data elements in memory.

The border node on the left side of the structure is similar to the Variant to Data function. The border node on the right side of the structure is similar to the To Variant function.