This content is not available in your preferred language.

The content is shown in another available language. Your browser may include features that can help translate the text.

Differences Between Flatten to String.vi and Variant to Flattened String.vi

Updated Oct 22, 2023

Reported In

Software

  • LabVIEW
  • LabVIEW Base
  • LabVIEW Full
  • LabVIEW Professional

Issue Details

What is the difference between the Flatten To String and Variant To Flattened String VIs?

Solution

These two VIs are very similar. In fact, they will return an identical string for all data types except variant. See the figure below.
However, The input data types are different between two VIs. Flatten To String requires all data types and Variant To Flattened String requires only variant data type. Please refer to figures below.
  • Flatten To String VIs
  • Variant To Flattened String VIs
 

Flatten to String VI will create a flattened string that contains the variant data as well as all variant attributes. However, Variant to Flattened String VI will convert only the data of the variant itself into a flattened string. It will not include any variant attribute data.

If you want to unflatten the data in each case, the following snippet will help you to understand.


 

Additional Information

The variant data type allows you to store attributes of the data. An attribute is information about the data that you define and the variant data type stores. For example, if you want to know the time when a piece of data was created, you can store the data as variant data and add an attribute called Time to store the time string. The attribute data can be of any type. You also can delete or retrieve attributes from variant data.