1. Launch Visual Studio and create a .NET framework class library project according to desired text-based language.
2. Insert either of the snippet code given below based on the selected text-based language.
Using VB.NET
Imports System.Math
Public Class MathsList
Public Function PythagorasTheorem(a As Double, b As Double) As Double
Dim c As Double
c = Sqrt((a ^ 2) + (b ^ 2))
PythagorasTheorem = c
End Function
End Class
Using C#
public class MathsList
{
public void PythagorasTheorem(double a, double b, out double c)
{
c = Math.Sqrt((a * a) + (b * b));
}
}
3. Press Ctrl-B to build the DLL. The built DLL file can be found in the Debug folder of the project path.
4. Open a new LabVIEW VI and drop the Constructor Node on the block diagram. Navigate to the location of the DLL by pressing the Browse button and select the DLL file.
5. Once the DLL is loaded, the constructor within the DLL will appear.
6. Place an Invoke Node on the block diagram and wire the output of the Constructor Node to the input of the Invoke Node. The method will appear when clicked on the Invoke Node.
Using VB.NET Using C#