Why Does the Set File Size Function Generate Garbage Data When Run on a Real-Time Target? Primary Software: LabVIEW Run-Time EnginePrimary Software Version: 8.0 Primary Software Fixed Version: N/A Secondary Software: N/A
Problem: I have a VI (attached file: SetFilePos.vi) that creates a new file and sets the file size using the Set File Size function. When I run this VI in the LabVIEW Development Environment the file is created and contains no data. Unfortunately, when I run the same VI on a Real-Time target the file is filled with garbage data. Why does the file created on the Real-Time target contain data if I didn't insert anything into the file? Solution: This is expected. When a file is deleted, the real-time filesystem won't format over the old data. Therefore when you create a file of a certain size, it might have old data in its sector. It is normal to find this old data around. Remember that any time you create a file of a pre-determined size, it is then your responsibilty to keep track of how much of the file you have written to. You must, for example, maintiain a header file telling you how many bytes are valid data. Related Links: Attachments:
Report Date: 03/02/2007 Last Updated: 03/12/2007 Document ID: 46L718UQ |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
