NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing VI Descriptioin from TestStand step

I am using TestStand (V3.5) to create test sequences that use LabVIEW (V8.2) VIs for the individual test steps.  My VIs are documented in the VI Properties|Documentation field with information that I would like to display in a TS Operator Interface.  When I add a Labview step in my sequence and specify the VI, I see the VI Description show up in the middle field of the Edit LabVIEW VI Call dialog box.  This information is stored in the sequence file when the VI is first added or when the "Reload Prototype" button is selected.  I would like to access this information using the TestStand API or with the expression browser.  I have searched using the Sequence Context browser and the Expression browser, but I cannot determine where this "VI Description" information is stored.  Is it possible to access this information from the sequence file?

Alan

0 Kudos
Message 1 of 7
(3,731 Views)
Hey Alan,

You should be able to access the VI Description with "Step.TS.SData.ViCall.VIDescription".  To view this property, you will first have to go to Configure>>Station Options, select the Preferences tab, and select Show Hidden Properties.  Hope this helps!
Pat P.
Software Engineer
National Instruments
0 Kudos
Message 2 of 7
(3,723 Views)
Hi Pat,

Thanks for the tip!  This works perfectly in my Operator Interface.


Regards,

Alan
0 Kudos
Message 3 of 7
(3,714 Views)
Alan,

A safer way to do this is to use the API.  The hidden properties remain constant in any version of TestStand.  However, NI reserves the right to change these properties in newer versions of TestStand.  This may cause problems if you ever intend to upgrade.

A safer way to do this is to use the Adapter API.

From Step.Module, you can access the code's module.  If it is a LabVIEW Module, you can cast it to be the LabVIEWModule class.  You can check it using the Module.Adapter.KeyName property.  From there, you can call the LabVIEWModule.VIDescription property.

Although the previous method will work in TestStand 3.5, it is subject to change in future versions.  However, we will keep the API updated if these properties are ever mapped to a different location.

Allen P.
NI
0 Kudos
Message 4 of 7
(3,709 Views)
Hey Alan,

Allen is completely correct.  The better method is to use the TS API.  Allen pretty much explained how to do it, but I wanted to post an example of how to get to it because it can be a little tricky if you are not familiar with how to do it in LabVIEW.  The main thing that can be hard to understand is how to "cast" TestStand types in LabVIEW.  The way to do this is with the Variant To Data.VI.  One other caveat, is you need to make sure to close both the reference that is passed into the Variant To Data and the reference that comes out of this VI.  The example I posted below does this.  Let us know if you have any more questions!
Pat P.
Software Engineer
National Instruments
0 Kudos
Message 5 of 7
(3,707 Views)
Hi Pat and Allen,

How do I access the Adapter API from a MFC/Visual C++ application?  Do I need to #import a DLL other than TEAPI.DLL or add another component to the project?


Thanks,

Alan

0 Kudos
Message 6 of 7
(3,674 Views)
Hey Alan,
You should just be able to include the tsapivc.cpp file in your project to get access to both the regular TestStand API as well as the Adapter API.  This file is located in <TestStand>API\VC.  Let us know if this doesn't work.
Pat P.
Software Engineer
National Instruments
0 Kudos
Message 7 of 7
(3,657 Views)