LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How store paths with LV, I'm looking the way to store paths?????

Solved!
Go to solution

I'm looking ways to store paths, so that when I run a VI that requires that path, I do not have to set it.

What I want is to establish it once> Store it> open a VI that automatically select.

I have an example but it gives a bad result.

example

0 Kudos
Message 1 of 7
(3,132 Views)

That's not an example, just a bad image. Why don't you attach the actual VI instead? Why do you have so many sequence frames???

 

There are millions of possible "bad results". Can you narrow it down a little bit and tell us in what way it is bad? (incorrect file, error message, computer explodes, etc.)

 

(Just looking at the image, there are many questionable constructs. Why is there no input to "check if file exists"? Why are there hollow output tunnels? What is in the other cases? Why are there so many case structures tied to the same boolean, can't you put all TRUE (or FALSE, resp) code in one case structure instead? This code is incredibly chopped up. ;))

Message 2 of 7
(3,116 Views)

wow...

Certified LabVIEW Architect
Certified Professional Instructor
0 Kudos
Message 3 of 7
(3,097 Views)

Ok, this is a functional VI. Firstly I'm write a code thats save the process of select a path for a file(wathever), now I designed this code for solve this problem, I'm designig a VI that needs a lot of paths(this path connects a .udl file to stablish a connection betwen LV and a DB in acces, then how I inserts/delete data to the DB from differents VI's, I prefer to do a VI that save the procces for stablish the connection. And I want to make this step auto;

1.png

The procces(how I want to run this VI in different systems, I try to do this VI);

1.- When I open a principal VI, my Conexion UDL.VI runs(for this I have created the DB and UDL file).

2.- I select the UDL file for stablish the connection.

3.-Then I select a folder for UDLreg.txt for save the path(in string) of the .UDL file.

3a.-The "Check if file or folder exists" is for the case in wich the UDLreg.txt dont exist create it and write the path.

4.- If the "Check if file..." indicates True(the file exist) this ignores the past step and read the file and indicates the Path for the .UDL

5.- This path is written to string indicator and I link this to the connector pane for use this in the mentioned VI's;) 

 

And so I created a vicious circle for don't select the .udl again. I hope that you can understandme.

 

The other way to do this is creating a relative path but how I want to create a .exe file for the VI and run in other pc's I can do this or I don't know how do it.

 

0 Kudos
Message 4 of 7
(3,090 Views)
Solution
Accepted by topic author abraham.oash

One thing to think about is creating a configuration file that contains any constant file paths you need.  I think its a bad idea to have hard coded paths in your code.  

Certified LabVIEW Architect
Certified Professional Instructor
Message 5 of 7
(3,088 Views)

But if I create a constant file path when I try to run the VI in different systems this could show an error?


I understand your suggestion, thankyou!!

0 Kudos
Message 6 of 7
(3,084 Views)

@abraham94 wrote:

Ok, this is a functional VI. 


No, it is still only a picture of a VI! 😞

 

I am glad it is working for you, but you could delete the entire flat sequence structure and nothing would change. The execution order is fully determined by dataflow anyway. Try it! 🙂

 

If you are using windows, this might be a situation where you could write a registry entry instead of a file. LabVIEW has full support for that.

 

 

0 Kudos
Message 7 of 7
(3,063 Views)