LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

.net invoke node cause labview crash

From the .NET pallette, i use a constructor node to connect to my device dll.  This connects ok but when i use a invoke noke to access its methods, i get a message "LabVIEW 8.5 Development System has encountered a problem and needs to close.  We are sorry for the inconvenience." and Labview closes.

I have deleted and saved and then redone the constructor to make sure i am pointing to the correct dll.  I am using LabVIEW professional 8.5 with .NET framework 3.5 SP1.

Any ideas?

Regards,

Grant

0 Kudos
Message 1 of 6
(4,235 Views)
Too many. Too vague. Are you sure the assembly you're using is compatible with .NET 3.5? Yes, .NET 3.5 is supposed to be backwards compatible, but we're talking about Microsoft here. What kind of arguments do the methods use? Does this happen with just the methods, or the properties as well? Does this happen in another environment, like C# or VB.NET?
0 Kudos
Message 2 of 6
(4,230 Views)

Have spoken with the dll creator and found out that the dll is using .NET 3.5 framework.  I have that installed on machine.  The dll was created in C# 2008 and a windows application also created in C#.  These work together ok so i believe the problem lies between LabVIEW and the dll.  I am only using the dll methods.

0 Kudos
Message 3 of 6
(4,225 Views)

Hi Grant_Cargill,

 

Thank you for contacting National Instruments. I have been doing some thinking about your error and it is difficult to judge what the problem is without seeing either the DLL or the VI. Could you possibly attach an example of a VI using this DLL so that we can try and replicate the issue here? Also would it be possible for you to provide a C# project that we could use as a reference for getting this DLL working with LabVIEW.

 

In order to try and help you out, I have attached some additional resources that may help identify this problem and resolve it. 

 

How Can I Stop LabVIEW From Crashing When I Run A VI With .NET or ActiveX Controls?

 

Requirements for Running a LabVIEW Executable that Uses .NET Assemblies

 

If you can have a look at both of these articles and let me know your findings, that will be much appreciated.

 

Many thanks,

Andrew McLennan
Applications Engineer
National Instruments
0 Kudos
Message 4 of 6
(4,180 Views)

Hi Andrew, i eventually found the problem.  It was because LabVIEW caused an exeption in the dll.  The dll did not handle this particular operation and therefore caused the exeption.  I am still currently testing this to confirm but so far, this looks like the most probable cause.

Regards,

0 Kudos
Message 5 of 6
(4,163 Views)

Grant:

 

Download and then run debugview while you run your vi, it may give you more specific information as to what is going awry.

 

http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx

 

-AK2DM

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 6 of 6
(4,150 Views)