LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI server and .NET question

Hi, I've looked up and down through the forum but cannot find documentation to understand my problem.
I have a exe buildt with LV 8.5.1, and it is a VI server.
WITHIN LV, I can interact with this server in this way:
1) I run the server (simply calling system exec)
2) now that the server is running, I call open application ref (localhost/60001) -> open VI ref (Main.vi) and here I can pass datas, for example I can change a boolean control (StopButton.value = true -> the server quits).

My question is:
 
Can I do the same within .NET? to do this, I need to know what kind of communication technology is "VI server"? what is the application layer? OLE/COM/ActiveX? I think no...
The lower layer is TCP/IP (even if it is always inside locahost, but it's ok), but the application layer?
This is essential because in Labview I pass data in "variant" data type, that has no .NET type equivalent!
Every "type" in labview is transformed ("flattened") into a "variant" type.
A similar process is called "serialization" in computer programming.

thanks
0 Kudos
Message 1 of 5
(3,538 Views)

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

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 2 of 5
(3,516 Views)

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.

Jarrod S.
National Instruments
0 Kudos
Message 3 of 5
(3,506 Views)

Thanks for the inputs.

I'm trying to explaing better.

This is the client labview code that open/use/close the VI server:

 

Clipboard01.jpg

 

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.

0 Kudos
Message 4 of 5
(3,502 Views)

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!!!

Message Edited by rolfk on 05-10-2010 04:17 PM
Rolf Kalbermatter
My Blog
0 Kudos
Message 5 of 5
(3,491 Views)