LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with LabVIEW calling a .NET DLL. Reference problem?


Please see the PPT slideshow also.

We created a .NET DLL being called by LabVIEW 2010.

 

*1  I created a C# application to call DLL wrapper functions (hence an instrument). No errors. The call was successful. C# returned the device version.
*2  Then I created a LabVIEW application to call wrapper functions (hence our PSD instrument). No errors. The call was successful. But LabVIEW did not return the device version.

We are suspecting the problem is with "passing the string reference".

Attached is all code and screenshots.

We have tried different combinations to pass the string. No response to LAbVIEW version query.

Also attached the log of errors inside the remote DLL.


(Please note: The LabVIEW program is successfully communicating to DLL. I know that the DLL makes some actions based upon LabVIEW .NET command Wrapper.Discover)

 

Please help.

 

0 Kudos
Message 1 of 15
(3,111 Views)

Here is the EXE version also (for .NET wrapper)..

0 Kudos
Message 2 of 15
(3,099 Views)

Hey Sandeep,

 

Are you making sure that you are inputting the correct commands into the invoke nodes that comply with the dll file?

 

National Instruments
Applications Engineer
0 Kudos
Message 3 of 15
(3,057 Views)

Hi  Z'Atari

 

I had an interesting finding today.

If I make an EXE out of this VI, it returns me the data.

 

What makes EXE work and DLL not work?

 

Thanks

best regards

0 Kudos
Message 4 of 15
(3,047 Views)

Hi Sandeepvd,

 

I am confused are you using labview to build the dll and exe? If so, the exe works but the dll doesn't correct?

Joe Daily
National Instruments
Applications Engineer

may the G be with you ....
0 Kudos
Message 5 of 15
(3,026 Views)

Hi Joe.

 

DLL is C#.NET DLL.

In both cases described, I call C#.NET DLL from LabVIEW program.

 

Case 1: Run a LabVIEW VI from the LabVIEW environment

Case2: Create an EXE (out of labVIEW same LV program that wraps around the same C#.DLL) and run as a stand alone.

 

I''ll be glad to provide further clarification.

 

Thanks

best regards

 

0 Kudos
Message 6 of 15
(3,008 Views)

Are you running the executable first or the LV development? Have you tried running the VI on startup? 

 

Usually, the problem we encounter is opposite, where the executable can't run the dll. 

National Instruments
Applications Engineer
0 Kudos
Message 7 of 15
(3,001 Views)

Try to create the 'response' string reference within your .net wrapper to ged rid of the 'out' parameter in LV.

Put additional debug information in your wrapper code.

 

Best regards

Christian

0 Kudos
Message 8 of 15
(2,993 Views)

Hi.

 

Thanks both for inputs.

 

I run LabVIEW VI first. Then EXE.

Swapping the sequence ...same result.

rebooting computer...........same result.

 

The "response" IS a string reference within the .NET DLL.

Having a reference inside the DLL does not mean that you get rid of output parameter from the inovolke node. Does it?

 

best regards

 

 

0 Kudos
Message 9 of 15
(2,976 Views)

Hi Sandeepvd,

 

This is Paul, another applications engineer here at National Instruments that will be helping you. So I'm still discussing with my colleagues about what the root cause of the problem could be. However, I did want to ask you whether or not this is the same DLL issue that you had discussed with Joel K, another applications engineer here at National Instruments? If so, I'll be able to sit down with him and get the root cause of this issue a bit faster. Thanks for your patience.

 

Paul M

National Instruments | Applications Engineer | www.ni.com/support
0 Kudos
Message 10 of 15
(2,914 Views)