LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

cant close labview file if program was writing data storage to disk due to temp

I have a DAQmx app that is acquiring lots of data to write to an excel file on disk.  I experinced a problem when I would hit the labview dev environment stop button on the toolbar because the program was not done writing to its temp file on disk and did not shut down and release the handle to the temp file properly.  Instead, the temp file handle was still open.  The enxt time I would run my program, the file would not open for normal IO operation because it was still in the grasps of the labview envioronment from before it was stopped.

 

How can I determine when the  write to measurment file is done writing? It creates its own temp file in a zip on the temp drive...I need to know when the file is done writing or a way to stop it so I can develop an orderly shutdown...

 

Any ideas?

0 Kudos
Message 1 of 4
(2,620 Views)

Simple.  Just let it get done writing.  If you want a visual way of knowing it's still busy writing, you can make use of the cursor functions in LabVIEW to display the system busy cursor.

 

Sorry, maybe I misunderstood you?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 4
(2,601 Views)
First of all, LabVIEW has a long history of hanging onto files and directories after its done with them. The solution is to quit LabVIEW -- a pain, yes I know...

Second, do not, repeat, DO NOT stop your program be hitting the stop button in the menu bar except as a last resort. Provide a way to stop your program gracefully -- this might even help your problem.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 4
(2,590 Views)

Why is it taking so long to write your file?  Are you accumulating a lot (like gigabytes) of data in memory and writing it out at the end of your program?  If so, you should consider streaming your data, a.k.a. "writing on the fly" as your data comes in.  Or are you writing something that needs to be done "all at once" because you are using a particular "Write X-Format File" that does the Open-Write-Close as a single step?

 

If the long write is truly unavoidable, but you are reasonably confident that it will always succeed, I suppose you could consider spawning the Write routine as an asynchronous call -- I think you can do this in such a way that you can close LabVIEW but the detached process will still run to its completion.  This might be dangerous ...

 

Bob Schor

0 Kudos
Message 4 of 4
(2,476 Views)