From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

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,913 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,902 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,889 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,874 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,862 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,860 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,817 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,810 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,782 Views)