12-17-2010 01:09 PM
Hi guys I can't seem to decipher why this error message is being given and how to get around it.
Error 6 occurred at Open/Create/Replace File in NI_LVConfig.lvlib:Save Config File.vi->NI_LVConfig.lvlib:Close Config Data.vi->write settings.vi:5->LP3000+.vi
Possible reason(s):
LabVIEW: Generic file I/O error.
C:\LP3000+\stop watches\ ljlogud.cfg
the stopwatch timer with the boolean array gives times for each individual array element and saves the valus to a cfg file. Even if the error message is shown the timer does not stop counting (which is good!!!). Also the error message apprears only periodically and not always. How do I get rid of the error message window? Any comment about the shortcomings of the code is also appreciated.
12-17-2010 02:24 PM
Well,
You only need to save the new values AFTER the main loop ends. Reading them once to start is good- write them once to save them for the next launch- the file isn't used by something else is it?
And we are off to the races.... the Local "Array" is read without regard to when the terminal "Array" is written. a classic race condition that nearly garuntees the last value written to the file is 1 iteration late. Again by getting the file writing outside the main loop you'll fix this issue too.
I'ld have used Shift registers instead of FB nodes but that's a matter of personal taste. The flat sequence structure should be removed (almost all of them should be obliterated, they are the devil's work.