Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview crashes

I am currently using Labview 7.11. I have recently come across with a problem after upgrading my PC from Window 2000 to Window XP.  And installed Measurement & Automation Explorer Version 4.2.1. Since then when I execute my Labview application it pops up a message. The message is “Labview.exe  has encountered a problem and needs to close” Then Lab view abort it self.  My application calls DLL. Does any body  know what could be the reason for this?

0 Kudos
Message 1 of 7
(4,142 Views)
calling dll's means to have a good knowledge about memory issues in passing arguments and know exactly what the dll and LabVIEW exchange.
This can be difficult especially if the dll is not  documented.
And if memory is corrupted LabVIEW will bring up this message.

greetings from the Netherlands
0 Kudos
Message 2 of 7
(4,123 Views)
Hi,

I have a few questions and suggestions for you:
1. Does LabVIEW ask you to Investigate Now or Later after the crash? Choosing Investigate Now will allow you send an error log file to an Applications Engineer for troubleshooting purposes.
2. Which version of LabVIEW is your DLL saved in? As described here, the LabVIEW VI and the DLL should be the same version.
3. Does this error occur when you are building the VI into an executable, or simply running the VI?

Here is another discussion forum post that I think might be useful to you. Hope this helps!
Amanda Howard
Americas Services and Support Recruiting Manager
National Instruments
0 Kudos
Message 3 of 7
(4,121 Views)

Thank you for your response and below is answer to your questions

  1. No. I have attached the snapshot of the pop up message for your reference.
  2. The Labview Version is 7.11. The DLL that I am using is not Labview DLL. It is C  DLL. I did not come across this problem when I developed the VI few months ago.
  3. The problem occurs when I execute the VI.
0 Kudos
Message 4 of 7
(4,096 Views)

Hi Albert, Thanks for your response,

I did manage to use this DLL with no problem in past.  That mean my Labview VI and DLL did communicate.

When you mention memory corruption do you mean PC’s RAM memory corruption?

0 Kudos
Message 5 of 7
(4,092 Views)
Yes

most of the time it has indeed something to do with memory not owned by the dll, so LabVIEW (by you not providing memory) will call a dll and pass a pointer to memory that is either not free to use or owned by LabVIEW and not free to be used by the dll.

e.g. if you pass a string and it is not null terminated C could end up to use all memory until it finds a zero character.
or you pass a too small array to your c-function

and that can happen months after starting to use this dll because no other program was using this memory or there were parameter changes between all other uses of the dll-call.

It is always difficult to call other languages with other types like arrays and strings. (they are implemented differently in c and labview)
greetings from the Netherlands
0 Kudos
Message 6 of 7
(4,091 Views)

Thank you Albert,

I revisited my Labview VIs and made sure all the string arguments to DLL are null terminated. Since then it didn’t crash.

0 Kudos
Message 7 of 7
(4,080 Views)