01-15-2007 02:02 PM
Hello,
I've have a fairly small vision application and the vision
Everything used to be in a single loop, and it worked in that setup, but the
complexity is growing that model was becoming unmanageable, so I set up
parallel loops. When I finished that,
labview started to crash.
At first labview would report that an external library had thrown an
exception. IMAQ Copy was normally the offending VI, but other vision functions
would throw exceptions. IMAQ Read Custom Data was fairly common. These
exceptions were common, usually happening within a minute of starting the VI.
Since image refnums are basically pointers in labview, I had used a semaphore
to prevent the acquisition loop from writing over an image that another part of
the program was reading. When I saw the errors, I modified the program to
prevent any two parts of the program from reading the image at the same time
(even though it seems that should be safe). That change made the errors much less common,
but they would still happen occasionally.
(and to make things more interesting, I let the program run for hours with
execution tracing turned on so I could see which IMAQ copy was causing the
exception, and it didn't crash once.)
Does anybody know how to debug exceptions in the vision library?
Also, recently, the annoying error messages have gone away and labview has just
started crashing without any kind of warning.
Does anybody know a method for debugging labview when the process just dies?
Thank you,
Adam Brewster
01-15-2007 02:22 PM
Hi Adam
It looks like parts of Labview are corrupted. Did you made an update of LabVIEW between the 2 versions of the application ? It could be that you messed up labview versions by using old VIs.
Whatever the origin, I would :
1 - Make a mass compile of the application.
2 - If it doesn't help, try to repair labview from the installation parts.
Hope this helps. If you want I can have a look at your VI
01-15-2007 02:28 PM
01-15-2007 02:37 PM
try mass compiling first (it is much faster) !
Cheers
01-16-2007 09:32 AM
01-16-2007 09:45 AM
01-16-2007 12:11 PM
The application is a little big to show screenshots of the
relevant sections, and I can't post the actual code.
I found one problem that I thought was causing this: I had used a semaphore to
protect access to the image that gets passed around the program, but I found
another image that's used in more than one place. I added another semaphore to protect the
second image and everything seemed to work.
Just as I was typing out my reply that said "I found the
problem" it crashed again.
Now I've got the exception dialog instead of labview just dying.
I guess I need to go through and look for any other images
that might be getting passed between
Thank you for your help.
01-22-2007 01:47 PM
For the benefit of those that may come
across the same problem in the future:
It appears that there were two problems.
1 - Insufficient use of semaphores. There were places
in the application where the same image was accessed by multiple
2 - IMAQ library calls claim to be reentrant, but
aren't. Even after making sure that different sections of the code
weren't working on the same image at the same time, the application would still
die from time to time due to an exception in external code. I was not
able to get any more details about the exception, but it killed my program
after about 5-10 minutes. I tried just about everything I could think of
to fix this without changing the library code, but nothing worked. I was
suspicious of the fact that none of the
Once again, thanks to Doc-doc for
helping me work this one out.
Adam Brewster
01-23-2007 03:49 AM