LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

File Path Control Causes Program to Freeze

I posted this question yesterday regarding the spreadsheet read/write vi causing my program to freeze and I thought it was solved, but it is not. So another post. I have attached a test vi that mimics that problem I am having. If a path control is used to specify a file name, the loop that writes data freezes until the file selection dialog box is closed. To run the test vi. choose a dummy file for the path control labeled "path to write test file" and then run the vi. If the "Not Wired Path" control is selected, a pop up file selection box comes up that freezes the second loop. Any ideas how to get around this. I appreciate the help!
0 Kudos
Message 1 of 4
(3,035 Views)

For others: thread being referenced: http://forums.ni.com/ni/board/message?board.id=170&message.id=423456

 

The reason why this is happening is that you are using the high-level Write to Spreadsheet File VI. The VI is being blocked at the Open File function. You need to use the lower-level functions and open the file before you start the loop, and in the loop just write the data. Close the file outside the loop. See attached mod. 

0 Kudos
Message 2 of 4
(3,023 Views)
Thanks for the help! Is there any other way to do this though? The problem with this solution is that in my main write loop, I have several files being written in sequence, and the loop architecture is state machine. I am not sure how to incorporate this solution into this program. Is there any other way for the user to select a file to read other than the path control that won't freeze the higher level write vi? Thanks again!
0 Kudos
Message 3 of 4
(3,012 Views)
There's lots of ways to do this, but fundamentally you have to prevent the blocking action from occurring, which is what was happening in your example. You could provide your own dialog, for example.
0 Kudos
Message 4 of 4
(3,009 Views)