Dear all
I come across a problem that confused me .
when i write a value into txt file ,then i read the txt file ,i find the value sometimes can be changed .it has probablity.
why txt file occurs thus phenomenon.if somedoby encounter thus problem as me.
Thanks.
> i find the value sometimes can be changed
To what ??
Did you flash after write?
If the value is old one, then it must Windows is holding the new value in the buffer.
If the value is new meaningful value, you might have a race condition.
If the new value is garbage, you have a bug.
Dear George Zou
Thands for you help
->Did you flash after write?
I don't know how to flash after write.
falsh after write will apply with which function ,if use the FileI/O->Advanded Fies Functions->Flush File.
attach is a simple write/read function with Flush file funciton.
please point out flaws in the program.
Thanks.
Best Regards
hoover
Sorry I made a typo. I mean "flush".
You don't need to set file size.
Use error cluster to catch errors.
Try this example:
C:\Program Files (x86)\National Instruments\LabVIEW 2013\examples\File IO\Text (ASCII)\Write to Text File and Read from Text File.vi
You don't even need to flush, close file does it.
Are you writing 中文 to the file?
Maybe try binary file instead of text file.
Dear George Zou
->Are you writing 中文 to the file?
I just write numerical value to the txt file ,for example ,12345.
Best Regards
hoover
Dear George Zou
I have tried ,example is no problems
blow website is post program sourcecode in the community,
please look over.
Best Regards
Then it got to be a bug in your program.
Other people already gave you good advise.
Simplify your program, remove none relative items one by one, until the problem gone.
That's how you debug.