03-21-2011 11:20 AM
Hello. I am getting an "Error 1 write to text file" in my acquisition program.
The error happens occasionaly and I can not figure out what causes the error. What is this error? If I ignore it and press continue the program seems to work and it records the data. The program acquires data, and records to several files. Attached is the screen shot of the error.
Thansk for the help
Solved! Go to Solution.
03-21-2011 11:24 AM
03-21-2011 11:26 AM
We can't tell very much from what you have posted.
Which Write to Text File did the error happen on and what are the values of input parameter when it happens?
03-21-2011 11:45 AM
Hi. Thansk for the quick replys 🙂
Attached are some more details: The error happnes in the main acquisition loop in the file-refs (attachment 1). Also the file naming happnes in a seperate while loop (ouside the main acquisition loop). i attached the logic of naming (attachments 2 and 3).
The error happnes only sometimes. The values during the error are just file refs numbers. I wasn't able to figure out the origin of the error and what causes it.
Thanks for the help
03-21-2011 11:47 AM
... when the erro happnes it happens for all file-ref cases (not juts the one i highted).
03-21-2011 12:01 PM
It's hard to make sense of your program without seeing it in its entirety. Please post your VI.
It certainly could be a race condition where you are trying to read a local variable of a file reference before you've set it.
03-22-2011 09:28 AM
Thanks for the reply... I agree that it is most likely the race condition. I put a probe on the name-ref where the error occurs and when there is an error the value is default 0. when there is no error the value is some ref number.
How do I go about solving it? I posted the .vi
Thanks 🙂
03-22-2011 03:35 PM
I got it. I added an additionl variable to start the recording only after the name-refs have been initilized. it was the race condition problem but now i know more about the labview data flow 🙂
03-23-2011 03:15 AM