NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Developing utility to load VI information like it happens in Teststand.

Hi,

I am curious to know about how teststand loads all the details of a selected LabVIEW VI when labview adapter is selected including connector pane info, in and out variables etc etc. I am a .net developer (also work on Python) and want to design similar utility like teststand in C# or Python which will function in similar way. (like loading selected VI file, invoking labview development and runtime environment, showing and mapping VI connector pane inputs and output variables etc etc.) Any idea how i can implement this? 

0 Kudos
Message 1 of 8
(3,052 Views)

I honestly think your question could go 1 of 2 ways so I'll answer both just in case:

 

Option 1: You are creating a custom step type and want to know how to display information in the step setting pane in the sequence editor.  This guide helps with that:

I think the source code is in the TestStand folder somewhere for the existing steps but I doubt you'll find the LabVIEW specific code.  That is mostly done by the adapter.

 

Option 2: You just want to get the VI info so you can embed it into your application as an image/text boxes.  In TestStand this is done through the adapter as mentioned above.  My guess is that they used VI server to accomplish this through its extensive API.  For instance you can print a VI including the context help and then delete the parts you don't want.  

 

Hope this helps,

 

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 8
(2,992 Views)

Guide link didn't go through.

 

https://www.ni.com/en/support/documentation/supplemental/18/creating-custom-step-type-edit-tabs-in-t...

 

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 3 of 8
(2,987 Views)

Thanx @jiggawax for sharing the links.

Through a little bit search on the web. I found this technique https://forums.ni.com/t5/Example-Programs/Simple-VI-Server-NET-Wrapper-using-LabVIEW-and-C/ta-p/3502...  which says to create our own interop assembly dlls.So, I opened the Vi Server C# project in visual studio, I execute it, it shows a dialog window to choose a VI and in the bottom, there is an option to check/uncheck "Run the VI?". But this code gives a .net error stating "Message=Method not found: 'NationalInstruments.LabVIEW.Interop.ErrorCluster VIServer.VIServerLib.OpenReference(NationalInstruments.LabVIEW.Interop.LVPath, Boolean, NationalInstruments.LabVIEW.Refnums.VI ByRef)'.
Source=VIServer Sample".
Then I found this https://www.ni.com/docs/en-US/bundle/labview/page/characteristics-of-labview-built-net-interop-assem... (In the bottom its mentioned that the Error clusters are not exported as parameters  which may throws an exception error. any idea on this?


Or how can I use the NI default interop DLLs in my visual studio c# project to achieve the desired functionality I elaborated earlier?

My approach is simple, through my .net utility i want to launch the active LabVIEW version installed on my system, auto detect the version of the VI am loading, show the connector pane image, mapping of the variables from the selected VI and fetching its data.

0 Kudos
Message 4 of 8
(2,953 Views)

Hello @jaggawax,

I was going through the NationalInstruments.LabVIEW.interop.dll functionalities. I can see the definitions of the functions prototype. Where can I get the complete documentation for this dll which I can refer for my .net development?

0 Kudos
Message 5 of 8
(2,925 Views)

I guess I'm still not sure how that interop helps?  Keep in mind I haven't done a ton of this so you are probably ahead of the game on this one.

 

However, I think using ActiveX and VI Server should get you what you need.  Also note that all of the documentation for VI server is in the LabVIEW help.

 

Have you seen this though?

https://forums.ni.com/t5/Example-Programs/Running-or-Calling-a-VI-using-the-LabVIEW-ActiveX-Automati...

 

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 6 of 8
(2,874 Views)
So,from above link i can open the provided C# solution in the visual studio 2019 and I am able to run the demo LV example Add.vi. through this method i can run the VI, that interop.LabVIEW.dll exposes methods to run the vi, set the VI icon, set the input controls value. Seems this works fine without using Open, close, Run.vi from earlier technique bcoz this create dependency on LabVIEW code (version issues). But this interop.LabVIEW. dll exposes very few methods and not like getting the control and indicators names in C# code, getting connector pane info, auto determining the LabVIEW version installed on the system, which is important for me. This technique is useful for me for further development as this has all through DLL only and not require any LabVIEW code. Can you help me to get the complete documentation for this interop DLL? and how i can add methods which i mentioned above(which are not there) to make it completely working. Thnxx
0 Kudos
Message 7 of 8
(2,562 Views)

Hi @jaggawax

Thanks for providing useful links..I have made much progress now, using single interop LabVIEW DLL to get the information related to selected VI using c sharp in development version as well as for runtime version of LabVIEW. These techniques working good for me. I'll keep you posted. 🙂

0 Kudos
Message 8 of 8
(2,356 Views)