Academic Company Events Community Support Solutions Products & Services Contact NI MyNI
2 ratings:
 3 out of 5   

How Do I Transfer Data Between Different Versions of LabVIEW?



Primary Software: LabVIEW Development Systems
Primary Software Version: 2012
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem:
In LabVIEW 2011, I used the Flatten To String and Unflatten From String functions to transfer data between different versions of LabVIEW, but in LabVIEW 2012, 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\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 illistrates how this can be done.

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

LabVIEW Version Hex Integer
2017 17008000
2016 16008000
2015
15008000
2014 14008000
2013 13008000
2012 12008004
2011 11008008
2010 10008000
2009 9008000
8.6 8608001
8.5 8508002
8.2 8208000
8 8008000

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.





Related Links:
LabVIEW Help 2012: Changing Format and Precision of Numeric Controls and Indicators

Attachments:

HexCheck.vi

Transfer Data ExampleTransfer_Data_Example.vi






Report Date: 05/05/2014
Last Updated: 07/26/2017
Document ID: 6L4F84MQ

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit