Table Of Contents

Calling .NET Code from Your Application

Last Modified: August 9, 2019

Integrate existing .NET code into your application by calling a .NET assembly from the Global Assembly Cache (GAC).

To call a .NET assembly, you must create a .NET document, or interface.

  1. Select File»New».NET Interface to add a .NET document to your project.
  2. Click Select Assembly to open, search, and select from the list of available .NET items.
  3. In the .NET document, select the .NET namespaces and classes you want to use in your application. In the Project Items palette, LabVIEW NXG creates new palettes for all of the namespaces and classes you select. These new palettes contain properties and methods that are entry points to the .NET assemblies. You can use these entry points in any project in your application.

    You must save the document to make the newly selected items available in your project.

  4. Open the VI in which you want to call the .NET code.
  5. On the diagram, select Project Items»Software. Then click the .NET folder to show every entry point you selected in the .NET document.
  6. Drop the entry points you want to use on the diagram.
  7. Wire the entry points like nodes and complete the diagram.
  8. Execute the VI. As the VI executes, input and output data passes between the .NET assembly and the diagram through the .NET entry points you specify.

Recently Viewed Topics