Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Creating .NET Objects on the Block Diagram

LabVIEW 8.2 Help
August 2006

NI Part Number:

»View Product Info
Download Help (Windows Only)

Complete the following steps to create a .NET object on the block diagram.

Note  Creating and communicating with .NET objects requires the .NET Framework 1.1 Service Pack 1 or later. National Instruments also strongly recommends that you use .NET objects only in LabVIEW projects.
  1. Place a Constructor Node on the block diagram.

    LabVIEW displays the Select .NET Constructor dialog box, which lists all public assemblies in the Global Assembly Cache (GAC). The Constructor Node is similar to the Automation Open function for ActiveX, except that a Constructor Node can specify initialization parameters for creating the object.
  2. Select an assembly from the Assembly pull-down menu. You also can click the Browse button to access private assemblies. .NET assemblies are .dll file types. After you select a private assembly, the assembly appears in the Assembly pull-down menu the next time you launch this dialog box.
Note  If you move a VI that uses a private assembly to a different folder or machine, you either must move the associated private .NET assembly files to a subdirectory that LabVIEW can search, or you must save the files in the Global Assembly Cache (GAC). If you build a VI that uses a private assembly into a shared library or stand-alone application, LabVIEW copies the associated private .NET assembly files to the data subdirectory in the same directory as the library or application.
  1. Select a class of .NET objects in the assembly from the Objects list. The constructors for that class appear in the Constructors section of the Select .NET Constructor dialog box.
  2. Select the constructor you want and click the OK button. LabVIEW displays the name of the class you selected on the Constructor Node.
  3. Wire the new reference output of the Constructor Node to a Property Node, Invoke Node, or Register Event Callback node to set properties or methods or handle events for that .NET object.
  4. Use the Close Reference function to close the reference to the .NET object.

You also can create a .NET control on the front panel.



Not Helpful