LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to change the excel base path in this project?

Solved!
Go to solution

Hello. Newbie question. This company just got a new local server and this project needs to save the information to the new server. The file path is named the same except for the name of the new server. But just changing the name of the path to the new server and saving doesn't do the trick. How should I go about this?

Download All
0 Kudos
Message 1 of 10
(231 Views)

Hi Kastun,

 


@Kastun27 wrote:

The file path is named the same except for the name of the new server. But just changing the name of the path to the new server and saving doesn't do the trick. How should I go about this?


Can you create a text file using the exact same filepath with Notepad?

Does the user account running your VI has access rights for that server?

Why do you save a CSV file using a XLS file suffix???

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
Message 2 of 10
(225 Views)

Hello and thank you for the response. I am an engineering student learning LabVIEW. I've only used it for motor control and a few other things so far. I am not sure if I can write to notepad yet. But it was previously writing to excel on the original server. I did not create this project or .vi. This is a small company with just a few local computers running LabVIEW, and one central local server that the computers are mapped to. The user account is the same and never changes. If they got a new server, would they need to register LabVIEW somehow to access that new server? Maybe that is the problem.

 

I have no idea why it is trying to save a CVS file with .xls suffix. It either has something to do with the format of data it is gathering, or it is just plain wrong.

0 Kudos
Message 3 of 10
(220 Views)

@Kastun27 wrote:

 

 

I have no idea why it is trying to save a CVS file with .xls suffix. It either has something to do with the format of data it is gathering, or it is just plain wrong.


Whoever programmed that VI was just plain wrong.  They concatenated a .xls extension onto a filename than proceed to create a file that is not an Excel file.  Change that ".xls" constant to ".csv" and you'll save a lot of confusion and conversion issues.

Message 4 of 10
(175 Views)

There appears to be lots wrong with this project. I think this was a bang and mash way to get the output to a spreadsheet. It does work, albeit recieving an error when opening the file. 

 

I am not there currently...what happens when I change the extension to .csv? It won't output to excel then will it? Or would I need to default excel to open .csv files? I downloaded the report and generation toolkit and checking it out.

 

Do you have any recommendations on the proper way to output this data into a spreadsheet? It's basically an appended 2D array that gets its data from a heirarchy of number to fractional string functions summed into build array functions.

0 Kudos
Message 5 of 10
(170 Views)

So I am realizing that this is definitely a newbie question as I didn't even know what a .csv file is. I am assuming that this LabVIEW structure is placing the elements into a comma separated value list, which is then placed into the respective rows and columns in excel.

 

I can handle all of that, but I still don't know why the file path does not work. I suppose this is more of a general network mapping question. I've done some experimenting and here is what I've discovered. If I use the path in LabVIEW:

 

\\new_server_name\some folder\desination folder

this does not work.

 

But if I copy the same path for "destination folder" directly from the url bar into LabVIEW

 

Z:\some folder\destination folder

this does work.

 

But here the new Z drive is the same as "new_server_name" 

 

So I am not sure why one works but the other does not. 

 

 

0 Kudos
Message 6 of 10
(163 Views)
Solution
Accepted by topic author Kastun27

@Kastun27 wrote:

So I am realizing that this is definitely a newbie question as I didn't even know what a .csv file is. I am assuming that this LabVIEW structure is placing the elements into a comma separated value list, which is then placed into the respective rows and columns in excel.

 

 


Exactly!  Technically, LabVIEW doesn't "place" anything in Excel.  It is Excel that runs its import routines when it opens the text-based CSV file that it knows how to break it up into rows and columns.

 


@Kastun27 wrote:

 

I can handle all of that, but I still don't know why the file path does not work. I suppose this is more of a general network mapping question. I've done some experimenting and here is what I've discovered. If I use the path in LabVIEW:

 

\\new_server_name\some folder\desination folder

this does not work.

 

But if I copy the same path for "destination folder" directly from the url bar into LabVIEW

 

Z:\some folder\destination folder

this does work.

 

But here the new Z drive is the same as "new_server_name" 

 

So I am not sure why one works but the other does not. 

 


Definitely a general network issue.  For some reason when you put the name of things, the DNS isn't resolving it.  If it doesn't work, is it throwing an error?  And if so, what is the error number and message?

 

But because you've mapped Z: to that path, The DNS lookup is resolving it okay.  Go with what works.

Message 7 of 10
(160 Views)

It throws a general "error 6" IO error. I am not there right now but I believe it said something to the effect of "could not write to file ...". I'll look into the DNS resolving, thank you. I won't know if mapping directly to Z:\ has worked until tomorrow, but since it worked in the test .vi I created, I am hopeful. And if that works, I'm pretty sure they will go with what works. 

0 Kudos
Message 8 of 10
(156 Views)
Solution
Accepted by topic author Kastun27

So to answer the Main Question:  If you "asked Google", you would learn that .CSV stands for "Comma-Separated Values", and refers to saving tabular data as lines of text, with columns separated by a Comma (hence the name) and rows separated by being separate "rows of (columns, defined by the commas) of data.

 

For reasons that are obscure (but potentially misleading), Microsoft Windows includes a "default icon" for .csv files that looks suspiciously as though it is an Excel™-related Icon.  Yes, Excel is usually "associated" with these text files, and will open it as though it was a legitimate Excel (instead of a plain text) file, but these files lack the fancy formatting, ability to include links, etc. that characterizes .xlsx files.

 

To add to the confusion, LabVIEW has a pair of functions in the File Palette called Read (or Write) Delimited Spreadsheet, which (by default) reads or writes files that follow the .csv idea, that is, pure text files, with lines and columns "defined" by specific characters.  To make matters more challenging, LabVIEW does not (by default) use the Comma character to separate columns, but uses a <tab> character (which can make aligned columns, if you are lucky).  However, there is an optional input to the LabVIEW functions to allow you to specify a comma as the column separator.

 

If you want to read real Excel files (with extension .xlsx), you need either NI's Report Generation Toolkit, which uses Excel to do the file handling and interpretation, or a third-party product, some of which might not need you to have Excel installed.

 

Clear?

 

Bob Schor

 

Message 9 of 10
(145 Views)

I was about to start looking into what DNS server that computer is trying to point to so I could change it to the new server, but mapping directly to Z:\ worked so he wants to keep it that way. Onto the next little fire. 

0 Kudos
Message 10 of 10
(132 Views)