LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using a file without specifying the root directory

Hallo,

I am trying edit a VI that uses a excel file from the network. I wish to make the VI work on the local system. I am able to do it but there is something I don't understand.

 

As seen from the file path attachment, the excel file path from network doesn't specify which network directory to use and the Read excel VI is able to process the file. When I try to do it locally, I have to the entire directory for the file including the Drive.

 

Why is this so? 

Download All
0 Kudos
Message 1 of 9
(2,938 Views)

@GoKu25 wrote:

the excel file path from network doesn't specify which network directory to use and the Read excel VI is able to process the file.


That image seems to show a full path to me.

 

If you must attach images (instead of VI's) insert them as photo's. That saves us two downloads...

0 Kudos
Message 2 of 9
(2,927 Views)

S:\Daten\_Planer\LD Manual Send Reports\LD_Manual_Send_Reports.xlsx (I thought this was the full path with the S drive)

 

This is the actual path from the network drive. Perhaps I don't understand the windows pathing terminology...

0 Kudos
Message 3 of 9
(2,914 Views)

The "\\" at the beginning of a path denotes Universal Naming Convention and can be used to specify server locations on the network.

 

Ex: \\server-name\main-folder\test.xlsx

 

S:\Daten\_Planer\LD Manual Send Reports\LD_Manual_Send_Reports.xlsx


This is an example of a local file path where the local drive is denoted by "S:\"

 

What is your intended functionality for the pathing? Does it need to be static to one location on the machine or dynamic based on the location of the VI?

 

Hunter D.
Applications Engineer
0 Kudos
Message 4 of 9
(2,899 Views)

On an unrelated note I see no reason why you have a sequence frame in your code. Simply use data flow to control the order or operations. All of the code seen in the picture has wires which will control the order of execution. No need to wrap it in a sequence frame.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 5 of 9
(2,887 Views)

On Windows, you can map a network address to local, for example:

\\erlh15la\me_ts$

to

S:\

 

From Windows Explorer menu, Tools=>Map network drive...

 

 

George Zou
0 Kudos
Message 6 of 9
(2,885 Views)

As pointed out by others your path is a UNC path and that is another valid absolute path under Windows that LabVIEW supports too.

Relative paths never start with a backslash, nor a volume letter like C:\

Rolf Kalbermatter
My Blog
0 Kudos
Message 7 of 9
(2,842 Views)

(Seems the path question is solved ...)

 


@Mark_Yedinak wrote:

On an unrelated note I see no reason why you have a sequence frame in your No need to wrap it in a sequence frame.


Agreed. He seems to be using the sequence structure for "documentation" via subdiagram labels. Not a good idea because it will hurt performance. Programming structures should not be abused for documentation.

 

For example, without the sequence structure, both FOR loops and the closing of the references can all occur in parallel, while in the current code they block each other. This is preventing a lot of compiler optimizations.

 

(Some of the FOR loop code also seems very convoluted. I am sure it could be simplified)

0 Kudos
Message 8 of 9
(2,835 Views)

Hi Mark,

I'm aware of data flow. As I mentioned in the post earlier, I did not develop the VI. It was given to me as such, to understand and change parts of it which I am trying to do.

0 Kudos
Message 9 of 9
(2,807 Views)