NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Obtain Value of Arbitrary TestStand Variable with Arbitrary Data type from LabVIEW?

I have a need to take a variable name, let's say:

Locals.Variable

 

and then from LabVIEW, retrieve its value regardless of data type (so a variant).  I tried to do this with the method

GetValVariant

 

but occasionally will receive an error:

-17308 Specified value does not have the expected type

 

 I'm wondering why this happens if a variant can handle any arbitrary type and if there is a way around this?



I saw my father do some work on a car once as a kid and I asked him "How did you know how to do that?" He responded "I didn't, I had to figure it out."
0 Kudos
Message 1 of 3
(2,519 Views)

Here it is a previous forum that shows a similar issue

 

https://forums.ni.com/t5/NI-TestStand/Specified-Value-Does-not-have-the-Expected-Type/td-p/389290

 

This can be useful for you. 

0 Kudos
Message 2 of 3
(2,476 Views)

Similar but not quite the same.  In my case, the variable in question is a container with all its elements predefined, none are dynamically added as is the case with the ResultList.

 

I did however resolve this by using the GetXML method instead which seems to handle any type of variable regardless of structure.



I saw my father do some work on a car once as a kid and I asked him "How did you know how to do that?" He responded "I didn't, I had to figure it out."
0 Kudos
Message 3 of 3
(2,473 Views)