07-31-2009 01:46 PM
So this question is kind of a continuation of my last post: http://forums.ni.com/ni/board/message?board.id=170&message.id=428065#M428065
I'm having a problem with labview crashing when I stop a VI. My program uses two .dlls. One written by Amptek to interface with a spectrometer of theirs and one written by me to create a structure (definied in the link above), get memory space for it (using malloc) and send a pointer from it to some functions in the amptek .dll. There are three events in my VI. One 'start' that opens USB communications with the spectrometer and sets a configuration; one 'test' that initializes an instance of this structure, puts some values into it, and then gives a pointer to this structure instance to the Amptek functions; and one 're-read configuration' (using functions from the amptek .dll) that sees if the values I put into the struct have ben recognized and recorded by the spectrometer. I've tried three different ways to stop the program: 1) the abort button 2) a 'stop' event -- value change from a stop button that then goes to the loop stop terminal 3) a 'stop' button in the main loop attached directly to the loop stop terminal. And for all three of them I get a pop-up message " LabVIEW 8.5.1 Development System has encountered a problem and needs to close. We are sorry for the inconvenience."
I think the crash only occurs after I've run the 'test' part of my program, which is where all the stuff from my .dll is used. So it looks as if there's some problem that I've created by using my own .dll.
I've attached the code for my .dll (which I compiled using minGW gcc) and the header. and the program that crashes.
Any suggestions would be greatly apprecaited. I'm out of ideas...
07-31-2009 01:50 PM
08-03-2009 06:08 PM
08-04-2009 10:12 AM
I've used highlight execution, but since the problem happens on 'stop' or 'close' I can't watch the execution to find the error. Like I said above I somtimes get an error 1097 from the 'test' part of the program, but that doesn't crash labVIEW.
This was probably unhelpful -- sorry.... But thanks for answering my post.
08-05-2009 03:49 PM
Hi check out this KB. It specifically adresses an issue where LabVIEW doesn't crash until the .dll is closed.
08-07-2009 04:02 PM
08-07-2009 04:43 PM
Not sure if debugview will assist your efforts, but it helped me nail down issues with dll's in the past.
http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx
-AK2DM
08-07-2009 04:52 PM