LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

SetPanelAttribute Hangs CVI?

Setting the Title Bar Text of a Panel using the SetPanelAttribute function causes CVI Version 5.0.1 Run Time to hang (can only be killed from windows taskmgr). The same code called on my development machine runs fine.

Anybody got any ideas?

Regards

Steve
There are 10 types of people in the world that understand binary, those that do and those that don't.
0 Kudos
Message 1 of 9
(4,567 Views)
It's normally something really stupid that is not as forgiving in the runtime environment as in the development environment. I've have similar issues were my application run fune if compiled in debug mode but failed when running in release mode.

The only way to resolve that is the determine the point of failure using a debug file, i.e. write out to a file were your program gets to and determine the point of failure in yuour various functions and then drill down in the function to the point were you catch the culprit.

This is what we had to do before we had all these really nice debugging environments.
Jattie van der Linde
Engineering Manager, Software & Automation
TEL Magnetic Solutions Ltd
0 Kudos
Message 2 of 9
(4,567 Views)
Jattie is right, it should be something that the debugger is helping out to correct. There are no report on the SetCtrlAttribute hanging; make sure that you initilie any variable that you are using and that the panel is properly loaded.

you can algo give a try to upgrading the Run-Time engine. CVI's run-tine is backwards compatible, so you could just install version 7.0 and see if makes any difference.

Again the best is to some debugging and see where the code isfailing.

Just my 2 cents.

Juan Carlos
N.I.
0 Kudos
Message 3 of 9
(4,567 Views)

I seem to have a related problem. CVI 8 was hanging when issuing a SetPanelAttribute command. This was in debug mode so it was easy to find. After some thinking and trying things I found that CVI did not like me setting the panel attribute from a different thread than the panel's creator. I re-arranged the code to create the panel in the same thread and it no longer froze. This may help someone else.

 

Vahid

0 Kudos
Message 4 of 9
(4,291 Views)
CVI 10.0.1 is doing the same thing. If you create a panel in thread1 and then SetPanelAttribute using thread2 it hangs.
0 Kudos
Message 5 of 9
(3,842 Views)

This is not expected behavior. Can you attach a small program here that reproduces this hang?

 

Luis

 

(Never mind, I've since been able to reproduce it with the ATTR_TITLE attribute. I'll keep you posted)

0 Kudos
Message 6 of 9
(3,836 Views)

Are you seeing this hang with the ATTR_TITLE attribute, as was the case with the original poster in this thread, or are you seeing it with a different panel attribute?

 

Luis

0 Kudos
Message 7 of 9
(3,823 Views)
Yes, I saw it with the ATTR_TITLE attribute only, but I didn't specifically test any others.
0 Kudos
Message 8 of 9
(3,813 Views)

Okay, good.

 

Yes, I did confirm that there is a bug in CVI that can occur when you set the panel title from a thread other than the thread that created the panel. This bug (ID: 314344) will be fixed in an upcoming release. In the meanwhile, the best workaround I can think of is for you to use the PostDeferredCallToThread function to force the title change to take place from the panel's thread.

 

Luis

0 Kudos
Message 9 of 9
(3,802 Views)