LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

.NET causes Labview crash

I have an application that is talking to a .NET dll written in C#. It will run and communicate to the dll. But, when the VI terminates I get a Labview exception and Labview crashes.
 
The VI, opens the .NET communications, accesses methods, instatiates objects, and calls a close at the end.
 
BUt when I terminate the while loop, and the VI should be exiting gracfully, it pukes.
 
Any clues?
 
David Clark
0 Kudos
Message 1 of 6
(4,003 Views)

Good afternoon David,

 

Thank you for posting to the NI Discussion Forums.  What exactly do you mean by a “LabVIEW Exception”?  Is an error returned to LabVIEW from a .NET property/invoke node, or do you mean that LabVIEW actually crashes (either your program or the development platform)?  99.9% of the time, LabVIEW treats .NET calls exactly the same as the same .NET calls from any other development environment.  Have you tried running the same series of function calls from another VB or C# program to see if the same exception is thrown?  I believe that the problem is probably somewhere in the C# code but without a more specific description on what the error is or the nature of the error it might be hard to offer any pointers.  You might want to start with the obvious things though -- look to make sure that any resources that are opened are being closed in a proper way, use of highlight execution with error clusters to determine the location of the crash, etc…  Also, consider posing a screen-shot of the code if it’s allowed, so that we can take a look at what might be going on.

 

Hopefully this helps!

Travis M
LabVIEW R&D
National Instruments
0 Kudos
Message 2 of 6
(3,999 Views)
Thanks,
The problem is probably something in our code, but there is no exception thrown when it run's under C#.
Is the something that must be done to .NET objects to clean them up properly? We may be missing it.
 
Thanks,
0 Kudos
Message 3 of 6
(3,996 Views)
Could you answer a few questions for me? I want to narrow down the possible issues...
 
1. What version of LV are you using?
2. What version(s) of .NET do you have installed?
3. Are you using a .NET config file on LabVIEW.exe to select the version of .NET?
4. Are these calls all simple invoke/property nodes? Do you use the .NET event handler? Do you use the front panel .NET container?
 
Also, could you post or email me (bloggingbrian@gmail.com) a screenshot of the crash?
 
Thanks
0 Kudos
Message 4 of 6
(3,988 Views)

LV - 71.

.NET - 2.0

No config files, no panel.

 

I'll email you screen shots

0 Kudos
Message 5 of 6
(3,971 Views)
 

Is this version of 7.1 actually the patched 7.1.1f2? If not, you'll need to upgrade to that in order to run with .NET 2.0. First apply 7.1.1

http://digital.ni.com/softlib.nsf/websearch/6C5F342A4AF4EF8986256F5400693C3B 

and then 7.1.1f2

http://digital.ni.com/softlib.nsf/websearch/E0768D56ECF0BDB9862570BB005C4CD9 

0 Kudos
Message 6 of 6
(3,959 Views)