LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

write to file dialog suspends all other code?

Greetings wireworkers,

I've recently run into a little snag that I'm not sure how to overcome, and I'm hoping someone will have experience to share.

My current project is a tester that controls for separate "stations" that run as four independent state machines.  

Because of it's "universal" nature, I'm just using the dialog to allow the operator to select and file name and location for his collected data.  The problem is that when the file dialog window opens, all my other stations stop until the window is closed.  

Is there something I can change to avoid this?  Or will this dialog always suspend other code?


Thanks.   Smiley Happy
---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 1 of 4
(2,472 Views)

The issus is that the write to file dialog is modal and is a synchronous call so that your state machine will freeze until this dialog is closed.  You can move your call to its own thread so that your state machine will continue to run but this will require some code reworking.  It is best to keep things like daq and control in their own thread/loop to run concurrently with the GUI thread. Use a synchronize methos to communicate between the threads.

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
Message 2 of 4
(2,464 Views)
I expected the dialog to stop the state diagram it was located in. I didn't expect it to stop ALL the state diagrams, including ones that are not even entering a state where that block exists.
---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 3 of 4
(2,461 Views)
Another option that I use is the Path control with the Browse... button enabled.  When the user clicks the button, the same file dialog appears and the code continues to run.  This can be configured to only allow an existing file or a new file.  With an Event loop, the control's Value Changed event fires.
Michael Munroe, CLD, CTD, MCP
Automate 1M+ VI Search, Sort and Edit operations with Property Inspector 5.1, now with a new Interactive Window Manager!
Now supports full project automation using one-click custom macros or CLI.
Message 4 of 4
(2,442 Views)