LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multithreading for user input through a dialog box

Hi all,

I'm writing a VI in Labview 6.1 that receives data from a server via TCP/IP.  Each time new data arrives, my VI processes it.  Under certain circumstances, I would like to prompt the user with Labview's built-in Two Button Dialog to select an action.  The problem is that the dialog seems to execute in the same thread as the main VI, and while it's open the background processing is suspended.  I would like for the VI to continue processing incoming data, even while the dialog is open and waiting for user input.

Does anyone know how to do this?  Thanks in advance!

cjb

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

You will have to multithread this application, that is put your TCP/IP in one loop and your user interface/GUI in another loop.  Loops can communicate through queues, locals or any other synchronize mechanism.  If you use a dialog inside the same thread as your data collection, the data collection will not continue until the modal message box returns (due to the data flow).  I am assuming that you are doing this but I don't have your code.  One other option is to not use the message box but make a popup subvi which is reentrant, allowing the execution to continue even before the sub-routine finishes execution, but this solutions can cause problems and the multithreaded solution is more safe.

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
Message 2 of 3
(2,542 Views)
Thanks Paul!  That works beautifully!

cjb

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