The file buffers are periodically flushed to disk anyway, but you don't know when Windows is going to do this.
The CVI library doesn't have an explicit function for flushing file buffers and I can't see any documentation that tells you if the flushing is forced internally. So maybe your best bet is to close the file after each write, to force the buffers to be flushed. Or you could move to the ANSI C FILE handling functions, which include an explicit fflush() facility.
Also, you should always try to use a journalling file system like NTFS rather than FAT or FAT32, as they have the capability to recover more data in the event of power loss or crash.
--
Martin.
--
Martin
Certified CVI Developer