LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

This assembly contains no public controls (source code provided)

Solved!
Go to solution

All,

 

Following this guide, https://forums.ni.com/t5/Example-Code/Calling-NET-Assemblies-From-LabVIEW/ta-p/3496957

I used dotPeek to look at the dll in order to see how I can create my own dll. See the C# source code that I compiled to a dll.

 

 

/*----------------------------------------------------------------
 * Module Name  : Testing
 * Description  : Used Dotpeek on the labview website example
 * Author       : Eli Barber
 * Date         : 28/02/2024
 * Revision     : 1.00
 * --------------------------------------------------------------*/



namespace Calculator
{
  public class TI83
  {
    public string manufacturer = "Texas Instruments";
    public string model = typeof(TI83).ToString();

    public int Add(int x, int y) {
      return x + y;
    }
    public int Subtract(int x, int y) {
      return x - y;
    }

    public int Multiply(int x, int y) {
      return x * y;
    }

    public double Divide(double x, double y) {
      return x / y;
      }

    public double Square(double x)  {
      
      return x * x;
      }
  }
}

 

 

command I used to compile to a dll.

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe /target:library Calculator.cs

 

Only problem is that while I can add the dll, it can't see my class or call any of the methods, what am I doing incorrectly?

elibarber_0-1709134989816.png

 

 

 

0 Kudos
Message 1 of 3
(396 Views)
Solution
Accepted by topic author elibarber

You trying to add .Net Control to the palette, but you haven't public controls, so instead of that you need to drop constructor on diagram, then select constructor, then it will work for you, your code is fine:

Screenshot 2024-02-28 17.03.14.png

Message 2 of 3
(384 Views)

You are a Genius! Thank you!

0 Kudos
Message 3 of 3
(372 Views)