Converting Variant Data to LabVIEW Data

Use the Variant to Data function to convert variant data to LabVIEW data. You must determine the data type stored in a variant before you convert the variant.

What to Use

Use the following block diagram objects to determine the data type stored in a variant and convert the variant to the data type.

Get Type Information VI Case Structure Variant To Data Function


 Add  Find
 Add  Find
 Add  Find

What to Do

Create the following block diagram to determine the data type stored in a variant and convert the variant to the data type.

The following list describes important details about the previous diagram.

The Get Type Information VI retrieves the data type stored in the variant.
Add a subdiagram for each possible data type. A subdiagram executes only when the variant data type matches the data type that appears in the selector label.
In each subdiagram, the Variant to Data function converts the variant.
In each subdiagram, the data type wired to the type input of the Variant to Data function must match the data type in the selector label. LabVIEW returns an error if the data type of the type input is not compatible with the data type of the variant input. LabVIEW ignores the value of the type input.

Related Information

Handling Variant Data

Converting LabVIEW Data to Variant Data