06-29-2009 01:25 PM
Hello all,
a very simple thing that I just don't seem to be able to figure out. I have a file containing 1024bytes of unsigned 16bit words. I can read it successfully with the right value being displayed. But then I try to write these values to a new file, I can no longer read the same value (in fact it's all grayed out 0) from the newly written file. The newly written file has the right size 1024 bytes, but I don't seem to obtain the right information. I made sure the endian are the same, little-endian.
Attached is my basic VI, and the .dat file is the file containing the binary information.
I'm not using copy file because once I get this figure out, I'll need to append more of the Scan.dat file to one single file.
Thank you!
Solved! Go to Solution.
06-29-2009 01:49 PM
I would put some wait time between the write and the read. It may be a good idea to actually close the file in between.
I have a feeling that you may not have allowed enough time to actually have the file written out before you read it again. That or since it is still open, the file pointer is at the end of the file and you are trying to read all the bytes starting at the end, which means you get nothing.
Not sure of the exact issue, but those two things comes to mind.
06-29-2009 02:11 PM
Darn it..such a simple solution and I didn't notice.
Yup I closed the file before reading and everything is working fine now. Thank you very much!!!!!!!