NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

using unstructured TS data and labview variants

I want to create a generic step to pass data from TS to LabVIEW but I'm pulling my hair. Why can't I use a Variant input on a VI to accept unstructured data fro TS? Is this possible? How can I flatten TS data into a LabVIEW Variant? In LV when you need to pass an unknown data type between a VI boundry, you use a variant. In TS you can do the same with an unstructured container. Is there anyway to pass unknown data between the two platforms? Actually correction: A variant output from a VI actually will show up on the TS side if you use an unstructured container but doesn't work the other way around.

I think the TS developers should get together with the LV developers over at NI and actually sit down over a few beers and talk. No I mean really talk. WTF?


Michael Aivaliotis
VI Shots LLC
0 Kudos
Message 1 of 12
(5,602 Views)
So it appears you cannot use the LabVIEW Variant datatype in TS. You can however use Binary String data in TS which will pass to LabVIEW string inputs. This will allow you to use the LabVIEW flatten to string function, however this TS Binary String data does not unflatten correctly when it comes back to LabVIEW. Does anyone know how to do this?


Michael Aivaliotis
VI Shots LLC
0 Kudos
Message 2 of 12
(5,584 Views)
Michael
Answers to the issues that you have raised. - I am assuming that you are using TestStand 4.0 or greater.
1. Why can't I use a Variant input on a VI to accept unstructured data fro TS?
- Thank you for bringing this issue to our attention. We are currently looking into this and will fix this issue in a future version of TestStand.
- If you only have a few steps, one workaround is to use a User Interface rather than the Sequence Editor to modify your step's specify module dialog. The UI specify module dialog does not seem to have this bug.

2. Regarding flatten to string
- I tried a very simple case of a cluster which had 3 controls inside it (a number, string, boolean) and I was able to flatten it and sent to TestStand and get it back without issues.
- One thing to make sure is that in specify module pane - make sure that you set the type of string to 'Binary String' rather than 'ASCII String'
- Your case might be more complex. Can you post a sample which shows the issue that you are having.

Regards
Anand Jain
National Instruments


Message Edited by Anand Jain on 02-08-2008 12:16 PM
0 Kudos
Message 3 of 12
(5,574 Views)
Michael,
This was reported to R&D (4I788IUZ) for further investigation.
 
However, in the meantime, I think we have found you an acceptable workaround.  Simply set the variant as a required input to your VI, and the expression edit box for entering information should appear.
 
Sorry that you ran into this problem!


Message Edited by Josh W. on 02-08-2008 01:37 PM
Josh W.
Certified TestStand Architect
Formerly blue
0 Kudos
Message 4 of 12
(5,564 Views)
Well, the problem goes even deeper because The Variant data gets manipulated by TS and becomes unusable when it goes back into the VI. See attached image.



When it comes out of the VI it appears as a Variant of data that can be converted back to a LV datatype if necessary. If I try to get it back from TS it shows as a OLE Variant which LV cannot handle.


Message Edited by Michael Aivaliotis on 02-08-2008 12:59 PM


Michael Aivaliotis
VI Shots LLC
0 Kudos
Message 5 of 12
(5,551 Views)
Michael,
 
I was able to reproduce what you are seeing, that the variant display is not the same on the output of one VI and the input of another.  However, when I used the Variant to Data VI and my type definition, I recovered the exact data that I had sent.  I am attaching my VIs and sequence file to this post.  If they do not work for you, or I have missinterpreted what you are doing, please attach a sequence file and VIs that will reproduce the behavior.
 
I ran the test with both the LabVIEW 8.5 development system and the LabVIEW 8.5 runtime engine, and got the same behavior.
 
If you place a breakpoint in your sequence after passing the variant to TestStand, you should see that the variable you assigned it to has automatically taken the form of the variant.  In my case, it appeared as an array.
 
What version of LabVIEW are you using?


Message Edited by Josh W. on 02-08-2008 03:35 PM
Josh W.
Certified TestStand Architect
Formerly blue
0 Kudos
Message 6 of 12
(5,537 Views)
Well heck, what do ya know, it works. I have no idea why it wasn't working for me before. Now that I'm trying it again on my code it works too! Well, thank you for your help.


Michael Aivaliotis
VI Shots LLC
0 Kudos
Message 7 of 12
(5,528 Views)
It seems that there is a limitation that I've come across. When the variant data is passed through the results data of a step it becomes invalid. I've modified the original code you submitted and was able to reproduce my problem. When you run the attached code, you will see a type mismatch error. Also, if you break it and look at the results variant data it does not contain the structure.



Using LV8.5 and TS 4.0.1

Message Edited by Michael Aivaliotis on 02-11-2008 02:12 AM


Michael Aivaliotis
VI Shots LLC
Download All
0 Kudos
Message 8 of 12
(5,507 Views)
Michael,
If you set the flag PropFlags_UnstructuredProperty on the Result container of the variant step type, the Result.variant subproperty will be populated correctly.
When a variant is passed to a TestStand variable, the variable is replaced by a new variable that contains the structure of the variant.  In this case, the Results.variant cannot be replaced because the Result container is not unstructured.
 
Regards,
Jose
 
 
0 Kudos
Message 9 of 12
(5,469 Views)
Nope, still not working. There seems to be a reproducable bug in TestStand. Here is the attached code that reproduces it.
The main problem is that when you pass the variant data through an assignment (variable1=varable2), the type information does not propogate.




Message Edited by Michael Aivaliotis on 02-14-2008 04:17 PM


Michael Aivaliotis
VI Shots LLC
Download All
0 Kudos
Message 10 of 12
(5,422 Views)