LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

implementing a .net function within labview

I haven't even a basic knowledge of .net interface within Labview (or .net in general).  I have a thrid party programmer writing a function for me that wants to deliver it as a .net DLL.   I will call the DLL from within Labview 8.5 and send in a string of info into the DLL and the DLL will pass back a string of info after it does its thing.   

 

I found the .net hooks in Labview and have read as much as is readily available but I still have no idea how to make this happen.  It seems everything that I find to read assumes you have some background already.

 

Can anyone suggest a document that walks through this process " a tutorial for total dummies" that doesn't require an indepth knowldege for implementation.

0 Kudos
Message 1 of 5
(3,148 Views)

I am not sure if you'll be able to find that kind of tutorial on the NI website but you should be able to find examples that show you how to call these assemblies from LabVIEW. What I first think you should do is to understand how .NET actually works. You can do this by searching for a tutorial on the Internet. Next, try to find tutorials on the Internet (again) to understand how they are called and work with programming languages in general. Then, I believe the implementation in LabVIEW will start making more sense to you.

 

If you have a particular example that you did like to understand, be sure to share that with us over here and we can try to help you out. Good luck!

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 2 of 5
(3,133 Views)

Assuming the programmer is creating a private assembly, you'd first place the .NET assembly in the same folder as your project/VI. .NET has specific rules on how it finds dependent assemblies. Thus, if the only dependent assemblies are the "standard" ones that ship with .NET, then you would only need the single assembly the programmer created. Otherwise  you would need to also place any other required assemblies in the same location.

 

To call a .NET method for a class, the basic steps are:

  1. Use a Constructor to create an object of the required class - when you place the contructor on the block diagram a dialog pops up asking you to select the assembly. You'd click the "Browse" button to select the private assembly. Then, in that same dialog you'd select the class that needs to be instantiated. I can't tell you what that will be since it's dependent on how the assembly was written.
  2. Use an Invoke Node to select the method you want to call - just connect the constructor node to the Invoke Node and then left-click on the Invoke node to display a popup that lists the available methods. Select the one you need. The parameters for it should be automatically populated. Wire up the appropriate constants/controls/indicators.
  3. Use a Close Reference to close the object.

If the programmer who is giving you the .NET assembly created a static method, then step (1) would be skipped - you'd select the .NET class directly for the Invoke Node.

 

 

0 Kudos
Message 3 of 5
(3,124 Views)

Thanks for the help so far.

 

Can anyone tell me what .net Framework is supported by LV 8.5.  I have 4.0 loaded on my machine but the NI Help that I downloaded alludes to the 1.1 service pact.

 

I am trying to use the Constructor to point to my .Net  DLL but it does not recognize the DLL as a .net assembly.  The assembly was created as a 4.0 and I wonder if I have a version conflict with the .Net Framework.

 

 

0 Kudos
Message 4 of 5
(3,098 Views)
LabVIEW 8.5 supports up to .NET 2.0.
0 Kudos
Message 5 of 5
(3,094 Views)