LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 7 when Using Write to Spreadsheet VI

Hi all,

 

I tried to make sure this wasn't a duplicate of any other posts, but the search returned 500+ results for Error 7, so I apologize if this is. I am attempting to use a CompactDAQ with the BNC analog voltage module to measure an analog signal. The VI plots the data in real-time in an X-Y graph on the front panel and builds an array as it goes (will change this so it just appends the file once this issue is solved, thus saving memory). I have attached the VI below so you can see the layout. When I run the program, I get the following error from the Write to Spreadsheet file:

 

"Error 7 occurred at Open/Create/Replace File in Write Spreadsheet String.vi->Write To Spreadsheet File (DBL).vi->PMT_DAQ_VI.vi

 

Possible reason(s):

LabVIEW:  File not found. The file might have been moved or deleted, or the file path might be incorrectly formatted for the operating system. For example, use \ as path separators on Windows, : on Mac OS, and / on Linux. Verify that the path is correct using the command prompt or file explorer.
=========================
NI-488:  Nonexistent GPIB interface.

C:\Documents and Setting\Tim\My Documents\LS_RawData\LightMeas010810_111404"

 

 I have no idea why this is happening. I am not using anything having to do with GPIB; the CompactDAQ is USB... Any help would be greatly appreciated. Thanks.

 

P.S. The user-defined VI just outputs the number string at the end of the file seen in the error message above. Simply a date and time stamp which doesn't violate filename rules in Windows. Thanks.

 

-Tim

0 Kudos
Message 1 of 12
(5,663 Views)

Your filename has an illegal character of " at the end. This is not a valid filename in Windows.

 

-AK2DM

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 2 of 12
(5,656 Views)

Does the path all the way up to the subfolder LS_RawData exist?

 

Put an indicator on the file path wire leading into the Write to Spreadsheet file function to see what the path actually is getting built to. 

 

Try it with a folder name that does not have the underscore character in it.

 

 

Message Edited by Ravens Fan on 01-08-2010 11:32 AM
0 Kudos
Message 3 of 12
(5,654 Views)

There is no " character at the end of the filename. That is closing the quotes which start at the end of the error message.

 

Tried deleting the underscores. No effect. Still get the same message.  And the path up to the subfolder does exist. The indicator is superfluous. The path the VI is attempting to write to is shown at the bottom of the error message. Unless LabView hates spaces in pathnames like MATLAB does, there is no reason that I can think of why pathname would be incorrect.
0 Kudos
Message 4 of 12
(5,643 Views)

Try Settings, not Setting

 

-AK2DM

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 5 of 12
(5,629 Views)

Yes, Analog Kid's reply is the solution.  I had gone through trying several things, including turning the path constant into a control, (set browing for new & existing, files & folders), and rebrowsing to the path.  That is what had fixed it for me, I just didn't realize it the first time.  I must have removed the underscore character at the same time suspecting it was involved and didn't realize what the fix was.

 

The indicator isn't necessarily redundant.  The dialog box shows the path split among 2 lines, while the file path indicator shows it as one straight string.  Sometimes you can see things differently if it is formatted differently.  Despite all that, I didn't see that the "s" was missing at the end of "Documents and Settings" until AnalogKid pointed it out.

Note, you can also right click on the file path constant on the block diagram and do a Browse for path to ensure that the path is correctly entered rather than typing it in.
Message Edited by Ravens Fan on 01-08-2010 01:15 PM
0 Kudos
Message 6 of 12
(5,614 Views)

Doh!

 

Thanks guys. I completely missed that. Biggest pitfall of programming: always overlooking something like that. I appreciate the extra sets of eyes.

 

-Tim

0 Kudos
Message 7 of 12
(5,609 Views)

Glad to assist. One tip I use if I need to copy a path is to drill down in Windows Explorer to where I need to be, then highlight it in the path bar and do a copy/paste.

 

-AK2DM

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
Message 8 of 12
(5,605 Views)

You can be sure of getting the correct path information by right-clicking on the file name in any Windows Explorer window, clicking on Properties, selecting the Location information by clicking and dragging, then, use Control-C or Edit-Copy to put the path on the clipboard.  [Size and Date fields can also be copied in this way]  Use the technique described above to capture the file name, which can then be appended to the path.

0 Kudos
Message 9 of 12
(5,326 Views)

What I described was another way to get the path name, if your Address bar is not visible.  You can get the file name copied by a right-click on the file name, click on Rename, then immediately do a Ctrl-C or Edit Copy while the name is selected in blue.  You can also select the file name by making two slow clicks on the file name but if you get the timing wrong, Windows will try to open the file.

0 Kudos
Message 10 of 12
(5,324 Views)