05-10-2010 01:53 AM
05-10-2010 07:18 AM
I think you may be getting your terminology confused. VI Server is part of LabVIEW that allows communication between different VIs at runtime and can dynamically call different VIs on different machines on different networks if required at runtime and dynamically run them.
.NET is someting entirely different
There is a .NET interface in LabVIEW, and if you want to communicate with a VI through TCP/IP to control a .NET object, then you should be able to do this as TCP/IP also has a LabVIEW interface.
Fundamentally, a VI that you build and compile as an exe is NOT a VI Server.
To answer your question may require a better formed question, it certainly requires a more experienced person than me when it comes to .NET, TCP/IP, ActiveX, OLE and the sort of low level stuff.
Althenbach is around at the moment an may post a better response.
James
05-10-2010 08:11 AM
VI Server is a LabVIEW-specific technology for communicating between VIs. It is based on TCP, but it's doubtful you'd be able to construct the proper TCP communciation from scratch from some other environment to communicate with LabVIEW VIs properly.
VI Server does, however, have an ActiveX automation interface that exposes a subset of the total functionality. You can enable this for your exe as well. This means you can automate LabVIEW through any application that can act as an ActiveX client, such as Excel, VB Script, etc. There are ways for .NET applications to act as ActiveX clients as well, but you'd have to do some searches to learn more about that. The implementation would not be LabVIEW-specific.
05-10-2010 08:16 AM
Thanks for the inputs.
I'm trying to explaing better.
This is the client labview code that open/use/close the VI server:
I'm just trying to figure out how to do the same in .NET, that's to say find an equivalent .NET/C# code for the "open app ref" + "open vi ref" + "pass a variant" .
The reason I'm trying to do this is that the VI server (see figure, left) is not "iconized on systray at startup", and it consist of a 150x150px window, semi-transparent, window.close + window.maximize BOTH disabled.
So I'm trying (if possible) to "wrap it up" in .NET (just start it, iconize and stop it), because I am able to:
1) start a process in .NET/C# code
2) iconize on systray in .NET/C#
Is systray interaction in labview a huge mess? In .NET it's really a couple of minutes.
Right few minutes ago, I found a working solution.
System.Diagnostics.Process.Start() will start the process (server), and a Process.CloseMainWindow() is the method that incidentally closes the server, even if on the GUI the window close button is disabled.
Also now I am figuring out that this solution does not solve my problem because my .NET app will be iconized on systray, but when I actually launch the server process, it (server) will be visible in the taskbar.
I will search how to let an application running + disappear from the taskbar.
05-10-2010 09:16 AM - edited 05-10-2010 09:17 AM
As has been explained already, the VI server interface is an internal LabVIEW interface. It has two distinct interfaces to the outside world. one is an ActiveX Server interface that supports a subset of the VI server interface. The other is a proprietary TCP/IP interface. The only software that really knows how to build according message packages is LabVIEW itself. The protocol is not documented, and as such not accessible from non-LabVIEW applications. If you need to interface to a LabVIEW application from an non-LabVIEW application you have to use either the ActiveX server interface or implement your own interface in both your LabVIEW app and your external app.
There is no other way!!!