12-17-2019 12:59 PM
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?
12-17-2019 10:26 PM - last edited on 12-03-2024 11:20 AM by Content Cleaner
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,
12-17-2019 10:28 PM - last edited on 12-03-2024 11:21 AM by Content Cleaner
Guide link didn't go through.
12-18-2019 03:55 AM - last edited on 12-03-2024 11:24 AM by Content Cleaner
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.
12-18-2019 08:45 AM
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?
12-18-2019 05:37 PM
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?
12-19-2019 06:15 AM
12-31-2019 06:49 AM
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. 🙂