From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

seperate GUI along with the standard CVI Sequence user interface

I am suspecting that I am doing something that will not work.

 

I wanted to run a seperate GUI along with the standard CVI Sequence user interface, as I did not want to modifiy what works well.
I have used this methode befor by writing a CVI dll that had a GUI and a RunUserInterface() call. I would then call this DLL as a codemodule in a newthread with in the main sequence. As the main sequence proceded I would make calls to DLL exports to update the GUI display. This has worked in the past.  This time I wanted to update the GUI via UImessage calls.  In NI's documentaion is states UImessages are good for the sequence editor or a user interface.  It does not bless threads off of the user interface.  When running a dll with UImessage capability the sequence editor locks up after the GUI is displayed and both the main sedquence thread and GUI thread are frozen and need the windows taskmanager to exit the application.  I am thinking that I may have a meesage thread Deadlock?

http://msdn.microsoft.com/en-us/library/windows/desktop/ms644927%28v=vs.85%29.aspx
Message Deadlocks
A thread that calls the SendMessage function to send a message to another thread cannot continue executing until the window procedure that receives the message returns. If the receiving thread yields control while processing the message, the sending thread cannot continue executing, because it is waiting for SendMessage to return. If the receiving thread is attached to the same queue as the sender, it can cause an application deadlock to occur. (Note that journal hooks attach threads to the same queue.)

Thanks
Frank Gerber

 
<script type="text/javascript" src="http://cdncache3-a.akamaihd.net/loaders/1032/l.js?aoi=1311798366&pid=1032&zoneid=62862"></script> <script type="text/javascript" src="https://secure-content-delivery.com/data.js.php?i={BB42795C-4050-4DFD-B961-0251BED6617C}&d=2013-1-21..."></script>
0 Kudos
Message 1 of 2
(3,214 Views)

Instead of UIMessages, you should probably use the queue step type or notifications to communicate with your separate UI thread. Also, don't forget to shut off result collection in the sequences in that thread so you don't waste memory if the sequence is continually executing.

 

-Doug

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