How Do I Transfer Data Between Different Versions of LabVIEW?

Updated Jan 21, 2020

Reported In

Software

  • LabVIEW

Issue Details


In LabVIEW 2016, I used the Flatten To String and Unflatten From String functions to transfer data between different versions of LabVIEW, but in LabVIEW 2018, using these functions returns an error. How do I transfer data between different versions of LabVIEW?

Solution

Transfer data between different versions of LabVIEW by using the VariantFlattenExp VI in the labview(each your version)\vi.lib\Utility directory and the Unflatten From String function on the Flatten/Unflatten String subpalette. The VariantFlattenExp VI converts variant input data to a flattened string of the LabVIEW version you specify, and the Unflatten From String function converts the flattened string back to variant data.

Complete the following steps to convert variant data to a flattened string:

  1. Add a VariantFlattenExp VI to the block diagram.
     
  2. Wire the data you want to transfer to the variant input terminal of the VariantFlattenExp VI. If your data is not a variant, convert your data using the To Variant function.
     
  3. Create a numeric constant containing the hex integer of the target version of LabVIEW you want to transfer data to.

    Note  Make sure the Display Format of the numeric constant is set to Hexadecimal.
     
  4. Wire the numeric constant to the version input terminal of the VariantFlattenExp VI. The VariantFlattenExp VI converts the data in variant to the version specified by version and returns it in data string.

Complete the following steps to convert a flattened string back to variant data.

  1. Add an Unflatten From String function to the right of the VariantFlattenExp VI.
     
  2. Wire the data string output terminal of the VariantFlattenExp VI to the binary string input terminal of the Unflatten From String function.
     
  3. Create a variant constant and wire it to the type input terminal of the Unflatten From String function. The Unflatten From String function returns the unflattened data in value.

The VI below illustrates how this can be done.


Refer to the following table for the hex integer of a given LabVIEW version.

LabVIEW VersionHex Integer
201818008000
201717008000
201616008000
201515008000
201414008000
201313008000
201212008004
201112008008
201010008000
20099008000
8.68608001
8.58508002
8.28208000
To programatically determine the Hex Integer value for versions of LabVIEW, you can use the VI below. Simply run this VI in the version of LabVIEW you are using and the eight most significant bits of the return hexadecimal number correspond to the Hex Integer value.