Get Variant Attribute Function

Owning Palette: Variant VIs and Functions

Requires: Base Development System

Retrieves the names and values of all attributes or the value of a single attribute, depending on whether you wire the name parameter.

The connector pane displays the default data types for this polymorphic function.

Details  

 Add to the block diagram  Find on the palette
variant is the variant data for which you want to retrieve an attribute(s) and value(s).
name is the name of the attribute whose value you want to retrieve. Do not wire this parameter if you want to retrieve all the attributes associated with the specified variant. If you wire name, the names output changes to a Boolean output found, the array output values changes to an output called value of the same type as default value, and the function searches for only the specified attribute.
default value is a value and data type that you specify. If the function does not find the attribute specified in name, it returns the default value. If you wire default value, you must wire name.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
duplicate variant is the variant data you input in variant.
names returns a 1D array containing the names of all attributes associated with the variant. LabVIEW sorts this array and arranges the array elements in ascending order using the same algorithm as the Sort 1D Array function. If you wire the name parameter, this output changes to a Boolean value found. found returns TRUE if the function finds the attribute that you specify in name.
values returns a 1D array containing the values associated with each attribute of the specified variant in variant format. The values in this array appear in the same order as their corresponding names appear in the names output. You must unflatten each attribute value to an appropriate data type. If you wire name, this output changes to a single variant value. If the function does not find the attribute that you specify in name, it returns the value passed to default value.
error out contains error information. This output provides standard error out functionality.

Get Variant Attribute Details

This function has two modes of behavior depending on whether you wire the name parameter. By default, the function returns the names of all attributes and their corresponding values in 1D arrays. If you wire name, the names output changes to a Boolean output found, the values output changes to a variant output value, and the function searches for only the specified attribute. If the function does not find the specified attribute(s), or if it cannot convert the attribute(s) to the default value, found is FALSE, and value displays the contents of default value.