From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

RunUserInerface()

I'n interested to perform LoadPanel, DisplayPanel and RunUserInterface
in one thread (controlled by TestStand call to a dll), but to use the
QuitUserInterface in another thread (called by TestStand).

Is it possible?

Thanks
0 Kudos
Message 1 of 5
(2,927 Views)
When dealing with UI threads, you should avoid situations like these. You must always process messages for the window in the same thread that created the window. A better idea would be to use some global flag that would signal the end of the UI and discard the UI from the same thread. You might get QuitUserInterface and LoadPanel() to work from different threads, but you will be setting yourself up for alot of trouble. Check out the section about "message processing" in this document.

Bilal Durrani
NI
Bilal Durrani
NI
0 Kudos
Message 2 of 5
(2,927 Views)
Thanks Bilal,

I beleive it will be much simplier if I describe what I want to do in
my project: TestSTan is executing several steps all of which are
doing some action on RS232 com1. I would like to open a 'window'
showing all the action going on on the port (created by CVI), at the
beginning of the steps (in the setup portion), and closed this window
only after the last step is executed.

As of now, I call this window in the beginning of each step and close
it when the step ends. I would like to eliminate this behavior of the
UI comming and going...

How can it be done?

Thanks
Rafi

p.s. Using TestSTand 2.0+CVI 5.5
0 Kudos
Message 3 of 5
(2,927 Views)
Rafi,

There is an excellent example of doing exactly this you can find here.

This example shows how you can launch the CVI UI using a sequence callback running in another thread then store the panel handle and the threadID in file globals. This way you can call back into the CVI dll in a later step and have the dll read the file globals to be able to manipulate the UI.

Regards,

Gerardo Garcia
National Instruments
Applications Engineering
0 Kudos
Message 4 of 5
(2,927 Views)
Thanks Gerardo,

I haven't had a chance to check it out yet, but it seems that this is
exactly what I was looking for.

Thank you very much
Rafi
0 Kudos
Message 5 of 5
(2,927 Views)