DLL Functions Unavailable to Be Selected on Call Library Function

Updated Mar 13, 2018

Reported In

Software

  • LabVIEW

Issue Details


I am trying to call a DLL using the Call Library Function node. However, when I browse to the DLL I am unable to select any of the expected functions in the Function Name pull-down menu.  Why are none of my DLL functions available for selection as below figure shows?
 

Solution

The DLL that you are trying to call is probably a .NET assembly, which also has the extension *.dll. However, .NET assemblies are inherently different to other DLLs and as a result must be called in a different way in LabVIEW. A .NET assembly is an object-oriented shared library and its properties and methods can only be accessed by instantiating an object using the .NET Constructor Node. The Constructor Node can be found in the Functions Palette under Connectivity » .NET.  Once you have placed the .NET Constructor Node on the block diagram, you can browse to the DLL you want to use by clicking Browse in the popup dialogue as shown in figure below.
 
 

You must then select the class and constructor method that you wish to use from the DLL as shown in figure below.
 

Additional Information

There may be many constructor methods for the class you wish to use. Consult the user documentation for the DLL you wish to access, if you are not sure which constructor to use.

The reference node that is passed out of the .NET Constructor Node then allows you to access properties and methods in the assembly using Property Nodes and Invoke Nodes respectively as in the figure below.



See  Calling .NET Assemblies From LabVIEW example for an example of how to call a .NET assembly from LabVIEW.

WAS THIS ARTICLE HELPFUL?

Not Helpful