LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

error code 11 in write to spreadsheet file

Hi,

 

I'm getting error code 11: too many files open when trying to write to a spreadsheet file.  I'm running LabVIEW 8.6 on a cFP-2220.  The vi calling the write to spreadsheet vi is running on the rt target. I've been running this vi for a couple weeks and have written164 files to the removable flash memory on the cFP controller without running into this issue.  Is there a way to see what files are open and ensure that the files are closed properly?  

CLAD
0 Kudos
Message 1 of 10
(3,392 Views)

Looks like WRITE TO SPREADSHEET FILE calls WRITE SPREADSHEET STRING, which unequivocally calls CLOSE FILE at the end, so I don't see an option for you to leave it open there.

 

Are you opening files from other places in your RT program?

 

Are you opening them via FTP from the host?

 

(I don't know cFP, but I know PXI). 

 

 

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


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 2 of 10
(3,383 Views)
Yes, I do have a part of the host application that accesses files over the ftp server.  It is just downloading them to the host though.  I do occasionally open files over the ftp server using My Computer.  Could that be doing it?
CLAD
0 Kudos
Message 3 of 10
(3,380 Views)

I'm not sure, but it could be.  If the message comes from the OS (and it probably does), then I would suspect that.

 

An open file is an open file.  If you open it from the host, but don't close it, does that count as an open file on the host, or on the target, or both?

 

I'm not sure, but I would eliminate that possibility if I could. 

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


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 4 of 10
(3,377 Views)
If your HOST program accesses the files, then double-check that part to make sure IT doesn't leave them open.
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 5 of 10
(3,374 Views)
How can I tell if they're open on the host?  The host is running XP.
CLAD
0 Kudos
Message 6 of 10
(3,368 Views)
I meant to double check your code on the host - if you OPEN a file make double darn sure you CLOSE it.
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 7 of 10
(3,364 Views)

Ok,

 

I found a spot in the program where I was opening an FTP session and not closing it.  Fixed that, didn't fix the problem.  There isn't anywhere in the program where I'm actually opening the files over the ftp server.  Basically, the program does this:

 

Logs on to ftp

Retrieves a list of all files in the d:/ directory on the cFP 

User selects files from list to download

Downloads files selected using FTP Get Multiple Files.vi to designated folder on host machine

Closes ftp session

Opens downloaded files using local machine path (ie: c:/Documents and Settings...)

Manipulates data and closes the file

 

The last file successfully written to the cFP flash memory was the 164th file.  Could I be hitting a limit for unique refnums within the RT OS?  Is there a way to double check that?

 

 

CLAD
0 Kudos
Message 8 of 10
(3,362 Views)

Are you saying that you get this error EVERY TIME now that you've passed the 164th file?

 

Are the files in a single folder on the cFP?

 

Things to try:

delete two files from the CFP.  If it write another one OK, then fails again, we have a hard limit somewhere.  Maybe he error message is misleading in that the files aren't necessarily OPEN.

 

Try organizing the files into daily folders, so that you don't have 164 in one folder. 

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


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 9 of 10
(3,357 Views)

Yep, that did the trick.  I'll try the daily folder idea and see if that fixes things permanently. 

 

Thanks for your help!

CLAD
0 Kudos
Message 10 of 10
(3,340 Views)