07-21-2015 03:58 PM
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?
07-21-2015 04:50 PM - edited 07-21-2015 04:51 PM
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?
07-21-2015 04:58 PM
07-22-2015 12:00 PM
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