11-29-2013 02:43 AM
Hi,
I am facing the error code 6 issue while trying to write to a text file. I have gone through all the posts which describes this issue and some possible solutions. I am still facing this issue. Here are some details:
1. The code writes data to a .txt file , which is always unique . Each time the application executes a new .txt file gets created as per the serial number of the UUT.
2. The error 6 is not very frequent , it appears once or twice duing its execution period over a month.
3. I have FGV which stores all the data and then writes it to the text file
4. I have also ensured that the code doesn't writes a huge amount of data at a time, so i am clearing the FGV after acquiring / writing the latest test data.
I am attaching the vi snippet for refrence
Thanks and Regards
11-29-2013 02:48 AM - edited 11-29-2013 02:50 AM
Hi arivb,
where does that error happen? Which function/subVI is affected? What is the file path at that function, when the error happens?
- Why do you wire the path through the whole FOR loop? It's not needed inside the loop?
- What happens when the (inner or outer) FOR loop runs for zero times? What happens to the file path that is wired through those loops? (That is one of the questions for the CLAD exams, that is asked for in every exam!)
11-29-2013 03:53 AM
Hi GerdW,
Yes you are correct the file path is not required to be wired through the for loop.
1. This error happens inside the sub vi Test log.vi. This subvi logs all the data contained in the FGV in the relevant text file. The snippet that i had attached is the same vi. This sub vi is being called at the end of the test in the main vi.
2. The file path is the local path located in C: and i am wiring a constant to it .
3. If for loop runs for one iteration it will log a single record in the text file.
Thanks and Regards,
11-29-2013 03:59 AM - edited 11-29-2013 04:00 AM
Hi arivb,
you didn't answer my questions:
1. At which specific functions does that error occur? "Inside the subVI" doesn't help here...
3. I asked for "what happens when the FOR loop runs for zero times?" as this can occur for both FOR loops! (When the FOR loops run atleast once everything should be fine...)
11-29-2013 04:14 AM
Hi GerdW,
The function where the error occurs is write characters to file .vi which is outside the for loop.
If the FGV is blank then the for loop will run zero times i.e it will not execute . As the vi path is wired through the for loop the function write characters to file.vi will get a blank path and will prompt for a file location .
But during the test the data is always present in the FGV , only after logging the data to text file , i am reinitializing the FGV.So there is no scenario of for loop to run zero times.
Thanks and Regards,
11-29-2013 11:01 AM - edited 11-29-2013 11:03 AM
Hi ariv,
As the vi path is wired through the for loop the function write characters to file.vi will get a blank path and will prompt for a file location .
That's what I wanted to point out...
The function where the error occurs is write characters to file .vi which is outside the for loop.
Which parameters/data are passed to that function when an error occurs? Did you check that?
Can you replicate that error using the same parameters/data in a fresh VI?
11-30-2013 03:02 AM
Hi GerdW,
The data which i am passing to the function are few strings.
I am facing this error code 6 issue in the EXE that too its very rare. The exe is a standalone application and supports a manufacturing line, so say for example in two weeks time i will get this issue once.
No i have not yet able to simulate this issue, i just ran the VI for couple of times but never got this problem.
Thanks and Regards,