From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Calling Labview dll from c#

I am trying to get started with importing a Labview generated DLL into C# in Visual Studio 2012.
I am trying to use an example provided on the webpage "Calling Labview VIs from Other Programming Languages".
The one that I am focusing on is callinglvbuiltdllfromcsharp.

 

When I opened CallingLabVIEWBuiltDLLFromCSharp.sln it had to be upgraded to the newer .NET framework.
Then I tried to add LabVIEWBuiltDLL.dll as a reference. That was rejected because I didn't have the proper
Labview runtime engine installed. I am currently using Labview 2013. I rebuilt the dll in Labview 2013 and
tried to include it again under references. I didn't get the error about the Labview runtime engine but the dll
could still not be added. The error message only said " ... Please make sure that the file is accessible, and that
it is a valid assembly or COM component". Then I added the dll as an existing item using Project -> Add Existing Item...
This was allowed and LabVIEWBuiltDLL.dll appeared in the solution explorer.

 

I ran the program but I got an error message saying DllNotFoundException was unhandled. What is the proper way to include
a Labview built dll into a C# application? Also is there a newer example created for Visual Studio 2012 and Labview 2013 (or Labview 2014) ?
I noticed that Labview 2013 produces a slightly different dll compared to the version that was used to build the example posted on the web.
For example, int32_t was used instead of long.

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

Hello irad,

 

DLLs built with LabVIEW are essentially the same as DLLs from another source, so calling them in C# will also be the same. Here are a couple of links that might help:

 

https://social.msdn.microsoft.com/Forums/en-US/72ee2c43-0847-4379-b0d2-af9ac8b5d80c/how-can-i-call-a...

http://msdn.microsoft.com/en-us/magazine/cc164123.aspx

 

0 Kudos
Message 2 of 4
(5,958 Views)

hola amigo, tengo el mismo problema, o pudiste solucionar?

0 Kudos
Message 3 of 4
(2,753 Views)

Hi barret20

 

What versions of software do you have? Have you checked the linked documents? Are you able to call other dlls? If you give more information we may be able to help you more.

0 Kudos
Message 4 of 4
(2,739 Views)