LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Converting path to refnum ?

I am working with a custom VI that I made that writes a 2D spreadsheet to a file during a measurement. The 2D data may later be appended, or optionally (at the start) the file may be created for this purpose (with a header file).

 

However, during a recent measurement, someone tripped over the power cable for the computer and all data (representing about 15 minutes of sensitive measurements) was lost since it was not flushed to disk.

 

The flush VI needs a refnum input. I want to place this VI just before the return of the call, so that this does not happen again (say - the computer crashes, or if I need to abort the measurement because some of the parameters went out of range, but do not want to lose the data already acquired).

 

So, how do I generate a refnum from a file path. If it matters, I am using Labview 8.6 on a Fedora 10 machine. 

Message Edited by m-s on 03-26-2010 01:36 PM
0 Kudos
Message 1 of 3
(3,385 Views)

Please post an image of your code so we can help out.

 

I suspect you are using an Express VI and it will have to be converted to real code so you can drop the flush inside it. Just opening another ref to the same file and flushing on that ref will not guarrentee the buffers asscosated with the other ref gets flushed.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 3
(3,376 Views)

Would Flush VI really help with this?

 

Are you sure the data was written?  I wouldn't think that Windows or any operating system would hold on to data to be written to a file for as long as 15 mintues.

0 Kudos
Message 3 of 3
(3,364 Views)