LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Variable Path Directory

I have a Program with a Main VI and several Sub VIs

All of the VIs read and write data to spread sheets.

 

I want to control the directory (file location and name) of the main VI and all the other linked sub VIs   from the front page of only one of the Sub VIs and the values inputed on this Sub VI by the user will be passed to the read/write name-location of the spreadsheet writing blocks across all.

 

 

0 Kudos
Message 1 of 4
(2,721 Views)

What problem are you having?

 

Are you familiar with the terminals on the sub-vis?  Your mainVI probably has a loop, which means you can place Shift Registers.  If you have more than one path you could create a cluster of path controls and pass this to the sub-vi, and the sub-vi could fill out the info which is then returned to the main vi.

 

Unless, you want this to happen while the sub-vi is still running.  In that case, you could use a control reference to pass the path to the main.  Or a trick is to use a "Functional Global Variable" also known as an ActionEngine or for the older people a LV2 Style Global.  Not to be confused with the normal Global Variable.

 

Can you describe what problem you are having?

0 Kudos
Message 2 of 4
(2,713 Views)

Me and a friend, for our first project with Labview, ever, are making a cash register program/ inventory tracker.  The main page and some of the VIs will be used by all people operating sales.  One of the Sub VIs will be locked so that only a few, trusted people, have access and in this sub VI is where the determining of the path/file location will be.  We will be operating this entire project on machines that dont have labview and thus will be running the program as an application.  In the future the program could be run on a different computer and thus we need to be able to adjust the file location.    So the file location will be controlled by a Sub VI that is password protected.  ALL VIs read and write from spreadsheet files.

What we would like to know is how we can "pass the file location name and directory" from the protected sub VI to the read and write command blocks of all the other linked VIs.

0 Kudos
Message 3 of 4
(2,705 Views)

Instead of complicating life, why not write to and read from an xml file that contains the paths.  Basically like a config file.  That way, the main VI simply reads the xml file and gets the path information.  Whereas another VI, which does not need to be a sub-vi, can be used to edit the path inforomation and any other info that you want to configure.

 

If you don't want people to be able to read and / or modify the info within the xml file, there are tricks to obfuscate the info.

0 Kudos
Message 4 of 4
(2,700 Views)