LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

When is EOF moved?

Hi,
I have a Labview 6.0 application which writes a packet (using Write File) of ~1,000 bytes, 100 times a second, to a hard disk on another computer (the drive has been mapped to a local drive using Windows). I have another application on the remote computer which polls the file, looking for the EOF marker to move, indicating a new packet has been written. When the marker moves I read in a packet using Read File. Occasionally I see the EOF marker move a packet's worth, but when I read in the packet it is all 0's. This problem seems to occur less often (but it still occurs) if I use Flush File after Write File, or if I put in a small delay between seeing the EOF marker move and calling Read File. Is it possible that Labview (or Windows) is moving the EOF marker before it has written the data? Is there a way to know when the data should be valid?

Thanks

Message Edited by Phamton on 05-25-2005 04:35 PM

0 Kudos
Message 1 of 2
(2,535 Views)
Hi Phamton,

You could implement some TCP handshaking between the two programs to communicate when the file has been updated, etc. This would be a lot more robust than just polling for movement of the EOF character, and it would eliminate the possibility of a race condition occurring when polling the position of the EOF character while the file is being updated.

Hope this helps,
Travis H.
LabVIEW R&D
National Instruments
Message 2 of 2
(2,505 Views)