|Download Help (Windows Only)|
After you build a .NET interop assembly, you can call the assembly from other programs that support .NET. However, ensure that the computer on which the other program runs meets the following requirements and recommendations:
When you build a .NET interop assembly, LabVIEW directly translates simple data types such as numerics, booleans, strings, and arrays of simple data types to the corresponding .NET data type. However, LabVIEW-specific data types, such as clusters, waveforms, complex numbers, refnums, and LabVIEW classes, require LabVIEW to define new .NET data types in the generated assembly.
One way to determine how LabVIEW converts its own data types to .NET data types is to build the .NET interop assembly and then view the manifest of the assembly in a .NET programming environment such as Microsoft Visual Studio. You can also use the MSIL Disassembler tool available on the Microsoft Developer Network (MSDN) to view the generated assembly. However, the following sections explain some basic details about how LabVIEW converts clusters, enumeration type controls, and LabVIEW classes to .NET data types.
LabVIEW converts clusters and enumerations to .NET structures whose elements correspond to the elements of the cluster or enumeration. LabVIEW uses the following rules to name the .NET structure that corresponds to a cluster or enumeration:
You can export the member VIs of a LabVIEW class. In LabVIEW, these VIs require the owning LabVIEW class as an input. Therefore, when you export these VIs to a .NET interop assembly, LabVIEW must create an equivalent .NET class definition in the assembly. The .NET class definition contains a static method for each member VI. Each of these static methods requires an instance of the newly defined .NET class as a parameter. LabVIEW does not export the private data of the owning LabVIEW class.
LabVIEW also exports the inheritance structure of LabVIEW classes whose method VIs you export. The generated .NET classes have the same inheritance structure.
When LabVIEW generates a .NET method for a VI, LabVIEW does not export the error in and error out clusters as parameters of the new method. Instead, the new method throws a .NET exception if an error occurs while the method is executing. This exception contains the same information as the error cluster.