LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

error 6 in write to spreadsheet file

Hello.  My program reads a 1D array of 12 values, then increments each value as the controlled components activate.  The program then writes the new value back to the file, replacing the old value.  After running for a time, I get the following error message:

 

Error 6 occurred at Open/Create/Replace File In Write Spreadsheet STring.vi->Write To Spreadsheet File (DBL).vi->(name of my vi.)

 

I read some posts which said that this could be a problem of the file getting too large.  Since I am writing over the same values, how can this happen?

 

Does anyone have any suggestions as to what can be done to prevent this error?  If the file is getting too large, how can I prevent this from happening? 

 

This is my first time posting.  Is there a better way to attach a pic of a vi/block diagram than what I have done?

0 Kudos
Message 1 of 14
(3,043 Views)

For future reference, it is best if you just post the VI itself.  It will make it easier on us to help.

 

Does the file increasing in size?  You can simply look at the file in Windows Explorer to find that out.  It also bothers me that you are rewriting the file so often.  Why not only write the file once the loop is complete?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 14
(3,034 Views)

What makes you think you are writing over the file. You have the Write to Spreadsheet File set to append. Did you look at the file you created? Change it to false and you will get a new file each time.

 

Yes, there are many better ways to attach your code. First, attach the actual VI or a snippet (look it up in the Help). The code or a snippet can be run. Second, attach a simple jpg or png.

 

edit - actually, that true you have may be for the transpose input. With the image, it is hard to tell.

0 Kudos
Message 3 of 14
(3,033 Views)

Dennis_Knutson wrote:

edit - actually, that true you have may be for the transpose input. With the image, it is hard to tell.


Yeah, I wasn't sure either.  It looks like it's going to the transpose though.  More reason why we ask for actual code.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 14
(3,017 Views)

I thought I was writing over the file because when I open the file, only the one column is filled with data, and the values are different every time I open the file.  I did not want a new file each time the data was written because we are doing the file write on a timed rate (0.5 seconds on and 0.5 seconds off).  Ultimately we are tracking the cycles when the controlled components fail.  That is why we need the cycle each time the components activate.

 

We don't open the file often, usually only when cycles seem peculiar or they are off track from what is expected. 

0 Kudos
Message 5 of 14
(3,014 Views)

I have attached the vi.

 

Yes, the True is going to the Transpose.  Sorry for any confustion.  I'll look up the snippet information as well.  The VI has a DAQ involved, so I did not know if anyone else would be able to run it due to DAQ-accessed components.

0 Kudos
Message 6 of 14
(3,011 Views)

Here is the snippet of the program.

0 Kudos
Message 7 of 14
(2,992 Views)

Dhouston,

 

A few questions:

 

1. While the program is running, do you ever do anything to the file like open it in XL or notepad? Do you ever run other VIs?

2. Can you take out the DAQ parts and see the same issue? 

3. How long before you see the error?

 

Error 6 is a bit tricky here. 

Charlie M. CLD
0 Kudos
Message 8 of 14
(2,963 Views)

1. While the program is running, do you ever do anything to the file like open it in XL or notepad? Do you ever run other VIs?

 

We only open the file when the program is stopped.  There are other VIs running, but those control other tests.  The VI running this particular test is alone.  It does not have any subVIs with it.

 

2. Can you take out the DAQ parts and see the same issue? 

 

I do not know how to operate the VI with the DAQ Assistant.  I am still new to Labview.  I do not understand how to apply the data acquisition VIs involving Reading, Creating, Triggering, etc. data acquisition events.

 

3. How long before you see the error?

 

The error has appeared twice within about 1000 cycles of component operation.  There is the thought that perhaps the program speed requirement is greater than what the NI 9481 can handle.  We are cycling the components at a cycle rate of 0.5 seconds on and 0.5 seconds off.

0 Kudos
Message 9 of 14
(2,948 Views)

We only open the file when the program is stopped.  

 

If the file is only examined after you stop the program, then just avoid the whole question and write the file only once, when you push the STOP button (or whatever stops the program)?

 

Rule #1 of making a program better, is don't do stuff you don't have to do.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 10 of 14
(2,942 Views)