Jump to content

Symbolic path: Difference between revisions

From LabVIEW Wiki
m Logmanoriginal moved page Symbolic Path to Symbolic path: Use standard naming conventions
Felipefoz (talk | contribs)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
A '''symbolic path''' (aka. ''pseudo path'') is a placeholder that represents one or more well-known locations in [[LabVIEW]]. When specifying a [[path]] to a file or folder inside a well-known location, rather than specifying the absolute path, the path is specified relative to the symbolic path. When accessing the path, it is resolved to the actual location, which may be different between machines, platforms, targets, and versions of LabVIEW.
A '''symbolic path''' (aka. ''pseudo path'') is a placeholder that represents one or more well-known locations in [[LabVIEW]]. When specifying a [[path]] to a file or folder inside a well-known location, rather than specifying the absolute path, the path is specified relative to the symbolic path. When accessing the path, it is resolved to the actual location, which may be different between machines, platforms, targets, and versions of LabVIEW.


So a [[VI]] that uses "<vilib>:\a.vi" may resolve to "<labview>\vi.lib\a.vi" when loaded for a desktop target, and "<labview>\vi.lib\fpga\a.vi" when loaded for a [[FPGA]] target.
A [[VI]] that uses "<vilib>:\a.vi" may resolve to "<labview>\vi.lib\a.vi" when loaded for a desktop target, and "<labview>\vi.lib\fpga\a.vi" when loaded for a [[FPGA]] target.


A symbolic path can also refer to multiple locations that [[wikipedia:superimpose|overlay]] each other as if they were a single directory. If a file with the same name exists in multiple directories, the first file found is used. The order in which directories are scanned may vary and can be determined using the [[Build And Resolve Symbolic Path]] VI with "symbolic path id" set to "<libdir>".
A symbolic path can also refer to multiple locations that [[wikipedia:superimpose|overlay]] each other as if they were a single directory. If a file with the same name exists in multiple directories, the first file found is used. The order in which directories are scanned may vary and can be determined using the [[Build And Resolve Symbolic Path]] VI with "symbolic path id" set to "<libdir>".


==Syntax==
==Syntax==
Symbolic paths are used similar to drive letters in Windows. For example, "<userlib>:/myfile.txt" specifies a file named ''myfile.txt'' in the [[user.lib]] directory.
Symbolic paths are used similar to drive letters in Windows. For example, "<userlib>:\myfile.txt" specifies a file named ''myfile.txt'' in the [[user.lib]] directory.


==Usage==
==Usage==
LabVIEW uses symbolic paths internally to store path to files and folders. For example, the [[lvproj]] file format stores paths to files using symbolic paths. Symbolic paths are also useful for [[VI Scripting]].
LabVIEW uses symbolic paths internally to store paths to files and folders. For example, the [[lvproj]] file format stores paths to files using symbolic paths. Symbolic paths are also useful for [[VI Scripting]].


==Resolving symbolic paths==
==Resolving symbolic paths==
In order to access the actual path that a symbolic path represents, the symbolic path must be resolved. In [[LabVIEW 2023 Q3]] and later, the [[Build And Resolve Symbolic Path]] VI should be used. In earlier versions from [[LabVIEW 2015]] and later, the [[Resolve Symbolic Path (VI)|Resolve Symbolic Path]] VI should be used. For even earlier versions, the private [[Resolve Symbolic Path (method)|Resolve Symbolic Path]] method, which was deprecated in [[LabVIEW 8.5]], can be used.
In order to access the actual path that a symbolic path represents, it must be resolved. In [[LabVIEW 2023 Q3]] and later, the [[Build And Resolve Symbolic Path]] VI should be used. In earlier versions from [[LabVIEW 2015]] and later, the [[Resolve Symbolic Path (VI)|Resolve Symbolic Path]] VI should be used. For even earlier versions, the private [[Resolve Symbolic Path (method)|Resolve Symbolic Path]] method, which is deprecated since [[LabVIEW 8.5]], can be used.


==See also==
==See also==
Line 19: Line 19:
==External links==
==External links==
*[https://lavag.org/topic/10549-resolving-symbolic-paths/ Resolving Symbolic Paths] (LAVA)
*[https://lavag.org/topic/10549-resolving-symbolic-paths/ Resolving Symbolic Paths] (LAVA)
*[https://forums.ni.com/t5/Community-Documents/Resolution-of-Pseudopaths-in-LabVIEW-Per-Target-Invocation-of/ta-p/4087124 Resolution of Pseudopaths per Target] (NI forums)


[[Category:Development Environment]]
[[Category:Development Environment]]

Latest revision as of 10:25, 24 October 2024

A symbolic path (aka. pseudo path) is a placeholder that represents one or more well-known locations in LabVIEW. When specifying a path to a file or folder inside a well-known location, rather than specifying the absolute path, the path is specified relative to the symbolic path. When accessing the path, it is resolved to the actual location, which may be different between machines, platforms, targets, and versions of LabVIEW.

A VI that uses "<vilib>:\a.vi" may resolve to "<labview>\vi.lib\a.vi" when loaded for a desktop target, and "<labview>\vi.lib\fpga\a.vi" when loaded for a FPGA target.

A symbolic path can also refer to multiple locations that overlay each other as if they were a single directory. If a file with the same name exists in multiple directories, the first file found is used. The order in which directories are scanned may vary and can be determined using the Build And Resolve Symbolic Path VI with "symbolic path id" set to "<libdir>".

Syntax

Symbolic paths are used similar to drive letters in Windows. For example, "<userlib>:\myfile.txt" specifies a file named myfile.txt in the user.lib directory.

Usage

LabVIEW uses symbolic paths internally to store paths to files and folders. For example, the lvproj file format stores paths to files using symbolic paths. Symbolic paths are also useful for VI Scripting.

Resolving symbolic paths

In order to access the actual path that a symbolic path represents, it must be resolved. In LabVIEW 2023 Q3 and later, the Build And Resolve Symbolic Path VI should be used. In earlier versions from LabVIEW 2015 and later, the Resolve Symbolic Path VI should be used. For even earlier versions, the private Resolve Symbolic Path method, which is deprecated since LabVIEW 8.5, can be used.

See also

External links