LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview remoting with .net

Labview 8.2 with .net remoting--- Currently we have a VB example, using .net remoting, where dll methods and classes are being accessed via an interface server at an IP address on the LAN. How do we do this same thing using Labview 8.2?
0 Kudos
Message 1 of 3
(3,276 Views)
Hello Jim,

I have receltly been interested in this topic myself and have been unable to find any example of value on the network.
But it's not so hard to get LV to work with .NET remoting. Actually it is as simple as integrating a .NET assembly to work with LV.

please study the example given in this link
http://www.developer.com/net/net/article.php/11087_2201701_1
this is very good example that explains the mechanics of .NET Remoting.
on the 4-th page of the link You have the ability to download an example.

I have written a LabView client application that connects to the server application provided in this example, so it is essential to understand how the above example works the LabView VI provided by me should be considered only an small addon.

Please find the attached zip file that contains:
- The binaries for the server application in the above example by Thriu Thangarathinam.
- LV client applciation ( developed on 8.5 version of LV but converted to 8.2 hope it works with no problems)

If you want the .NET sources for the server, please download the example form the original Authors page.

Hope this helps,
Maciej

0 Kudos
Message 2 of 3
(3,238 Views)
I have only very recently (last week) gotten back to this; however, I have been successful with only one exception. That exception is that it appears it may not be currently possible (LabVIEW 8.5) to register LabVIEW to receive .NET events from any .NET object that is accessed through a .NET remoting channel. See this post for details.

I agree that it is necessary to have a good understanding of .NET remoting.

That said, the basic process that has been successful for me is this:

In LabVIEW, first call the .NET functions that open the appropriate channel over which you will do your remoting. I used a flat sequence structure to do that in LabVIEW. I have also encapsulated that functionality into a .NET class library since our .NET code uses it widely, so I have LabVIEW load that .NET class library, then I use an Invoke node to execute the function that opens the remoting channel.

Once you have the remoting channel open, you can pretty much access any remoted object in LabVIEW except for what I have described above. In my .NET assemblies that supply remoted objects, I have static properties that return a reference to the remote object. The static properties call "ActivatorGetObject" to get and return the reference to the remote object. In LabVIEW, I use a property node to access those static properties.

Our remote objects are hosted by Windows services, so as long as the service is running, ActivatorGetObject returns a reference to the requested object. In addition, all our objects that are hosted by the services are singletons, so, ActivatorGetObject returns a reference to the running singleton object.

I hope this helps.
0 Kudos
Message 3 of 3
(3,193 Views)