LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

DisplayPanel failure when run in thread on VISTA

I have quite old CVI application, which runs fine on Windows XP.One of the user interface panels runs in a separate thread. When recompiled on VISTA using CVI 8.5.1 it dies on call to DispalayPanel and panel never shows up. When stepping in debugger, I can see that function call to DisplayPanel never returns. Has anyone experience similar issues, when running panels in a separate thread on VISTA? Is this a problem known?  What about CVI 9.0? I haven't try it yet. Can it help?  

Pawel K

0 Kudos
Message 1 of 8
(3,944 Views)

Hello Pawel,

 

Would you be able to submit the application to the NI ftp site, so that we could try to reproduce the problem?

 

Thanks,

Luis

0 Kudos
Message 2 of 8
(3,921 Views)
Unfortunately application is quite big and complicated. I would have to strip it down to make it useful for testing this particular issue.Are there any simple examples of panel running in a thread? I would be glad to check if those are working under VISTA. If they are I should look at code of those and compare with my code.If there are no examples and nobody can point to any solution, I may have to strip my application down or write a simple example based on my code before I can submit code.

 

Pawel  

 

0 Kudos
Message 3 of 8
(3,896 Views)

Hi Pawel,

 

You can find several examples of panels in multithreaded applications in C:\Users\Public\Documents\National Instruments\CVI85\samples\utility\Threading\*.*. Those should work just fine in Vista, but it probably depends on exactly which actions are happening concurrently within each thread. Let me know if you are able to reproduce the problem.

 

Luis

0 Kudos
Message 4 of 8
(3,864 Views)

I found temporary solution.

 

My application was calling directly Win32 API to create threads and was using Win32 events for synchronization. In particular main thread was waiting for an event from there newly created thread, confirming that the UI panel was created and is ready to accept input.

It seems that I have an issue with Win32 events or timing on VISTA. When I put main thread to sleep for the time adequate to start another thread with UI panel, my application became working.

 

This is temporary solution as I should find a root cause of the problem. In the meantime I can make my application working on VISTA, and I'm quite sure that there is no issue with DisplayPanel to run in a separate thread.

 

Pawel

0 Kudos
Message 5 of 8
(3,805 Views)

I have a CVI7.1 application which I loaded onto a Vista laptop. The program uses multithreading, and worked just fine. Until, that is, the Vista machine accidentally got set to Power Saver mode. Then the threading just didn't want to work at all. Very odd symptoms - but basically the inter-thread messages (including the CVI TCP library callbacks!) just stopped working. Set the machine back to High Performance mode, restarted the program and it all sprang to life again. Curious!

 

JR

0 Kudos
Message 6 of 8
(3,780 Views)
That is interesting.  It looks like the Power Settings in Vista change the power management of the processor.  When set to Power Saver, the processor works between 5-50% by default.  On High Performance, the processor works at 100% by default.  That may have something to do with why the processor is not working properly in Power Saver mode.  You could try adjusting these settings to be sure that is the case.  Do you have a later version of CVI you could test to see if this is still an issue?
Eric B.
National Instruments
0 Kudos
Message 7 of 8
(3,745 Views)

I don't have a later version of CVI. The program was written to run on XP - I was only trying out Vista out of curiosity, so its not an issue for me. Another related possibility might be something to do with the Dual Core CPU the Vista machine had - maybe one of the cores gets shut down in Power Saver mode; if this happens after threads/event signalling resources have been committed to the powered-down core it is not surprising that strange things could happen.

 

JR

0 Kudos
Message 8 of 8
(3,733 Views)