ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"File Path Control" default Value

Hi - How do we set or change the default value for "File Path Control" (Control --> String & Path ---> File Path Control)?

 

I typed the default path into the control field on the front pannel and save the VI file.  The value gone when I reopen the file.

 

 

 

 

0 Kudos
Message 1 of 19
(6,776 Views)

Right click on the control, go to Data Operations>>Make Current Value Default

0 Kudos
Message 2 of 19
(6,770 Views)

How do we set to NOT valid the path value?

0 Kudos
Message 3 of 19
(6,759 Views)

I would drop a Not A Path constant on the BD, right-click and Change to Control.  The default value is now set for you.

 

If you use Modern controls you can click on the % glyph and choose Not A Path, but I use System controls so that is why I go the constant route (plus the auto default setting is nice)

Message 4 of 19
(6,755 Views)

By the way, I realize I never paid attention that there's a difference between Not a path and Empty path... Why?

0 Kudos
Message 5 of 19
(6,717 Views)

@Jimmy.chretien wrote:

[...] difference between Not a path and Empty path... Why?


Not a Path is a specific value for the path (<Not a Path>).

Developers should use this to prevent situations in applications, where a user has to select a path before performing an action (e.g. saving a file). If the user skips the path selection, the application still has "Not a Path" and can prevent errors and tell the user to select the path (error handling!).

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 6 of 19
(6,694 Views)

If it returns empty path, the developer can easilly do the same error handling, I don't see the point....

0 Kudos
Message 7 of 19
(6,672 Views)

@Jimmy.chretien wrote:

If it returns empty path, the developer can easilly do the same error handling, I don't see the point....


Not as easilly since an empty path returns F for the comparison

Capture.PNG


"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 19
(6,667 Views)

@Jimmy.chretien wrote:

If it returns empty path, the developer can easilly do the same error handling, I don't see the point....


The empty path on Mac/Linux is the root of the file system.  When you write paths such as /path/path it is actually (empty)/path/path.  The upshot is that the empty path is perfectly valid on those systems and not really a useful sentinel value.  <Not A Path> is such a sentinel.

0 Kudos
Message 9 of 19
(6,661 Views)
There is a "Empty String/Path?" function in LabVIEW.

@JÞB wrote:

@Jimmy.chretien wrote:

If it returns empty path, the developer can easilly do the same error handling, I don't see the point....


Not as easilly since an empty path returns F for the comparison

Capture.PNG


 

0 Kudos
Message 10 of 19
(6,651 Views)