LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Code runs fine in debug mode but hangs when compiled in release mode

Solved!
Go to solution

I am struggling with the following problem. I have code which runs fine when it is executed in debug mode. However, when I compile it in release mode and run the executable, the code freezes and does not work. The code acquires images from a Hamamatsu camera. In the debug mode I am able to continuously acquire images. However, in the release version, the code hangs after acquiring the first image.

 

I am using LabWindows/CVI version 7.

 

I would greatly appreciate if I can get any help/suggestions in resolving this problem?

 

Thanks!

 

Regards,

Sripad

 

0 Kudos
Message 1 of 2
(3,117 Views)
Solution
Accepted by topic author SripadRam

Sripad:

 

If you search this forum for "debug release crash" or "release version crash" or similar phrases, you'll find that this is a pretty common question.  Look through the other posts you find here to see if anything is applicable to you.

 

The debug version does some things like padding variables so you can sometimes overrun your declared variable space without overwriting the next variable.  In the release, the variables are packed, so if you overrun one, you are overwriting another.  Just one possible difference.

 

You can do some things in your release code to see where things get lost, like (temporarily using printf statements after multiple statements at the start and end of your loop to try to identify that failing line of code.

 

Look through other threads to find other ideas.

0 Kudos
Message 2 of 2
(3,113 Views)