DLL Functions Unavailable to Be Selected on Call Library Function

Updated May 9, 2019

Reported In

Software

  • LabVIEW

Issue Details

I am trying to call a DLL file 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 drop-down menu, the drop-down is even disabled. Why are none of my DLL functions available for selection?
 

Solution

The DLL that you are trying to call is probably a .NET assembly, which also has the file 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:
  1. The Constructor Node can be found in the Functions Palette under Connectivity » .NET.
  2. Once you have placed the .NET Constructor Node on the Block Diagram, double-click it to select the constructor.
  3. In the popup dialog, click Browse to navigate to the DLL file you want to use:
  1. Select the class and constructor method that you wish to use from the DLL e.g. as shown in figure below:

Additional Information

There may be many constructor methods for the class you wish to use. Consult the 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 the example Calling a Private .NET Assembly.vi shipped with LabVIEW for an example on how to call a .NET assembly from LabVIEW. You can find it by opening the Example Finder (menu Help » Find Examples), then navigating to Browse » Communicating with External Applications » .NET » Calling a Private .NET Assembly.vi.

WAS THIS ARTICLE HELPFUL?

Not Helpful