LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Use .NET C# DLL in NXG 5.0

Solved!
Go to solution

I'm evaluating LabView for test automation within our company. I used LabView in college, but haven't worked with it since. We have a huge codebase written in C#, so it is critical that we can leverage our .NET DLLs in LabView projects, otherwise it is probably not worth purchasing the tool.

 

I have spent HOURS reading the forum posts as well as looking at the External Code (DLL) Execution example project, but I cannot seem to make any progress. Any YouTube demos I've found are for older versions of LabView (and not NXG, whatever that means).

 

I created a .NET Framework Class Library project in Visual Studio, added a public class with one public method and a property, and built it. I copied the resulting DLL into the LabView project directory, then File->Add File to add it to the project. This is where I get lost. I have tried adding a Shared Library Interface (SLI) and referencing the DLL from the browse dialog. This didn't seem to do anything. I also tried adding a DotNetInterface (DNI), but that only seems to display the standard .NET Framework DLLs from the Global Assembly Cache.

 

I'm very new to LabView at this point, so I could be missing something extremely obvious.

0 Kudos
Message 1 of 5
(1,216 Views)
Solution
Accepted by topic author BurnAndLearn

While I can't know what your exact requirements are for test automation, I have to ask why you're using NXG instead of LabVIEW 2020.  NXG is LabVIEW's path towards the future, but right now it lacks a lot of features, and a lot of convenient references (like YouTube videos about it, for instance).

 

LabVIEW NXG is a completely new system that is being built from the ground up, and just a few years old.  What it is NOT is "the most recent version of LabVIEW".  They are separate products, just a common name due to their common architecture.  I strongly advise you to try regular LabVIEW 2020 and not just give up on the environment because NXG isn't able to do what you want (yet).

0 Kudos
Message 2 of 5
(1,194 Views)

I've barely used NXG, but from what I can tell it appears  you can only import assemblies that are in the GAC (and are therefore digitally signed) (https://www.ni.com/documentation/en/labview/5.0/language-integration/call-net-lv-app/) . This is certainly a hassle.

 

You are better off using LabVIEW "Classic" as it stands. NXG is a newer, parallel-developed product that is an "off-shoot" of LabVIEW Classic which may (or may not) eventually replace it. But NXG is still significantly feature incomplete and the upgrade process is far from painless. So I suspect that NI will take a long time for any phase-out plans.

0 Kudos
Message 3 of 5
(1,187 Views)

Hi Kyle,

 

Thanks for the reply. As an outsider, it was unclear to me which version I was supposed to install. To me, NXG appeared to be the "latest and greatest", but apparently it is just the "latest". I'm installing LV2020 right now to see how far that gets me.

0 Kudos
Message 4 of 5
(1,183 Views)

FYI - LabVIEW NXG in its current form is being phased out - see https://forums.ni.com/t5/LabVIEW/Our-Commitment-to-LabVIEW-as-we-Expand-our-Software-Portfolio/td-p/... 

0 Kudos
Message 5 of 5
(1,145 Views)