02-28-2024 09:44 AM
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.
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?
Solved! Go to Solution.
02-28-2024 10:00 AM - edited 02-28-2024 10:03 AM
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:
02-28-2024 10:08 AM
You are a Genius! Thank you!