LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

imaqDisplayImage hangs when running .exe and the window can't be moved when in Debug mode

I am running a multi threaded application with multiple windows, two of which display images but only one is open all the time.  The window displaying the image (using imaqDisplayImage(myImage, 1, TRUE)) can not be moved or resized, the image continually updates though, when I run the app in debug mode.

 

If I run an executable, either debug or release the following happens:

Everything looks good right when the app starts, all windows are displayed and the live image window is continually updated.

If I click on any window in my program or not in my program, the imaqDisplayImage window freezes and will not udate its image, it will allow me to move it though, and it has (Not Responding) in the title bar.  The main window of my program does not freeze and behaves normally. 

 

I know that an acquisition is still taking place because I have a button on my main window that copies the last grabbed image that should be displayed in the imaqDisplayImage window and displayes it on a canvas (using imaqImageToArray etc . . .) and this image changes everytime I click the button.

 

Anyone have any tips with dealing with imaqDisplayImage windows??  Thanks!

0 Kudos
Message 1 of 3
(2,893 Views)

At this point we want to pinpoint exactly where in your code this behavior is originating from. Try running the included examples which can be found here:

 

C:\Program Files\National Instruments\MeasurementStudio\CVI\samples\IMAQ\Display
C:\Program Files\National Instruments\MeasurementStudio\CVI\samples\Vision\1.GettingStarted

 

and see if you experience the same behavior. If we still experience this, then we know that it is a setting within the functions that we need to change. If not, we know that it is somewhere else in the code of the bigger project which is the culprit. 

Daniel G.
Semiconductor & Wireless
National Instruments
0 Kudos
Message 2 of 3
(2,876 Views)

I just stumbled across this thread whilst experiencing the same issue.

 

I discovered that if you aren't explicitly handling the messages from the display windows you should call imaqSetWindowThreadPolicy(IMAQ_SEPARATE_THREAD) before calling imaqDisplayImage().

 

This will stop the display windows from showing as not responding as any display window messages will be handled automatically in the background.

 
 
0 Kudos
Message 3 of 3
(1,022 Views)