NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW Variant to String Conversion Produces Unexpected Output When Called from TestStand

Hi all,

 

I have a LabVIEW VI that takes a variant input, converts it to a string using the Variant To Data function, appends a fixed message, and then outputs both the concatenated string and its variant form. The VI works as expected when I run it directly in LabVIEW.

However, when I call this VI from TestStand and pass a string variable (e.g., "Hallo") to the variant input, the output string in TestStand is not what I expect—instead of "Hallo Test!", I get a garbled string like "E@=3@JI0100h]Lc8o<99EG@85YE8:\^GA8=g<CO<9<4_A460]g48b".

 

Has anyone encountered this issue?

  • Is there a recommended way to pass a string from TestStand to a LabVIEW variant input so that the Variant To Data function in LabVIEW correctly interprets it as a string?
  • Are there best practices for handling variants between TestStand and LabVIEW to avoid type mismatches?

 

Thanks in advance for your help!

0 Kudos
Message 1 of 4
(197 Views)

Hello Python007,

When you pass a LabVIEW Variant into TestStand, the resulting string like the one you obtained it might be a serialized representation of the variant data. This format is not human-readable and is used internally by LabVIEW and TestStand to preserve complex data structures. If you want to extract the original string from this variant in TestStand or LabVIEW:

  • Use LabVIEW’s Variant to Data function to convert it back to the original type.
  • In TestStand, you can:
    • Pass the variant back to a LabVIEW VI that knows the expected type.

To do so, from LabVIEW follow the next link: Product Documentation

It will guide you through the software to allow you to convert properly the desired characters.

 

Have a good day,
Hugo

Message 2 of 4
(50 Views)

@Hugo_Hauet wrote:

Hello Python007,

When you pass a LabVIEW Variant into TestStand, the resulting string like the one you obtained it might be a serialized representation of the variant data. This format is not human-readable and is used internally by LabVIEW and TestStand to preserve complex data structures. If you want to extract the original string from this variant in TestStand or LabVIEW:

  • Use LabVIEW’s Variant to Data function to convert it back to the original type.
  • In TestStand, you can:
    • Pass the variant back to a LabVIEW VI that knows the expected type.

To do so, from LabVIEW follow the next link: Product Documentation

It will guide you through the software to allow you to convert properly the desired characters.

 

Have a good day,
Hugo


Hey Hugo thanks for your reply

 

I fallowed your link: To do so, from LabVIEW follow the next link: Product Documentation

 

I created this VI:

Variant to string.png

If I pass a string in TestStand to the variant input LabVIEW recognise the type as "External Data" and not as "String":

python007_0-1761032492509.png

 

Best regards

0 Kudos
Message 3 of 4
(36 Views)

Those Variant Data Type Parsing VIs works only within LabVIEW.

Doesn't work when the caller is a TestStand sequence.  At least not in TS2017.

 

George Zou
0 Kudos
Message 4 of 4
(15 Views)