NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW Variant Attributes get lost in TestStand?

Hello,

 

Example code attached.

 

I'm using a LabVIEW variant as a lookup table by using the attributes (see here: https://decibel.ni.com/content/docs/DOC-25371 (and others)).  It works well.  When I attempt to pass this variant from one TestStand step to another, I lose the attributes of the variant.  I've made a small example to demonstrate this.  Am I doing something wrong?  Why does the variant retain the value, but not the attributes?  Should I store this as another type in TestStand?  In the documentation for LabVIEW types in TestStand, it is claimed that a Variant in LabVIEW maps to "Anything" in TestStand.  When I tried to use a Boolean, however, I got an error and was instructed to use a Container.  Does that container need to have some specific suptype to retain the attributes?  Or does it have nothing to do with that?

 

Thanks in advance

 

CLA, CTA
Not my tempo... AGAIN!
0 Kudos
Message 1 of 5
(3,011 Views)
Highlighted

Hi GarryG,

 

I am curious to know what version of TestStand you are running.

0 Kudos
Message 2 of 5
(2,878 Views)
Highlighted

2015 DS1 version (It's TestStand 2014).

CLA, CTA
Not my tempo... AGAIN!
0 Kudos
Message 3 of 5
(2,876 Views)
Highlighted

Hey GarryG,

 

Here is an excerpt from the NI Product Support Engineer's response on this issue:

"Unfortunately, this is a known limitation with LabVIEW variants in TestStand.  When LabVIEW variant data is returned to TestStand from a LabVIEW code module, the data overwrites the property. TestStand does not have a mechanism to "fit" the returned variant data to the TestStand type, so unfortunately you will need to either remap the data to the type, or use a cluster rather than a variant."

Essentially, it appears that variant data can not be guaranteed to work properly in TestStand. In order to ensure you have your data passed from your Code Modules correctly, I would recommended following the Product Support Engineer's advice of remapping or clustering the data. If this is not possible, the Flatten Variant to String.vi could be an alternative to try. I was able to confirm that this has not been fixed with TestStand 2014 either.

Typecasting LabVIEW Variants in TestStand Forum Post:
http://forums.ni.com/t5/NI-TestStand/typecasting-Labview-variant-in-Teststand/td-p/2160452/page/2

 

I hope this helps!

Message 4 of 5
(2,844 Views)
Highlighted

Cool!

 

Good to know I'm not just doing something silly.  This is unfortunate, because one of the most useful things I've found with the variant is the variant attributes as a hash table.

 

I've come up with my own workaround, which is to pass the variant by DVR from one TestStand Step to another (using a Sequence Local).  A DVR to teststand is just a numeric type.  Then, there is no loss of information when the second VI uses an in place structure to get at the variant via the DVR.  Maybe this will help others hoping to do the same.

 

 

CLA, CTA
Not my tempo... AGAIN!
Message 5 of 5
(2,841 Views)