Relative File Path

From SysCAD Documentation
Jump to navigation Jump to search

Related Links: General Controller, PGM Include Files, Get Tag List, Set Tag List, Plant Model Set Tag List, Task Model, Events Model, Profile Model, Queue Profile Model, Command Scripts

Introduction

A SysCAD model often references external files. These are often saved within the project folder but in most instances they can also be saved in folders external to the project. This allows a number of projects to point to a common set of files.

Use of Relative File Path

In most of these instances of use of external files, SysCAD allows the file path to be specified relative to the project folder (the assumed current directory). So use of "double-dots" syntax ("..") to indicate the folder above the current folder can be used.

Models which allow the use of Relative File Path include the following:

Alternative

For files which are stored external to the project, an alternative is to simply browse for the location of the external file using the browse button Browse Button.png.

Example

A set of projects wants to reference a common set of data. The projects (including CfgFiles) are contained in a folder called "Plant Model" which also contains a folder called "Data" which contains the common data.

Data Folder.png

One of the files to be referenced is called "Data1.csv". Within any of the projects contained in the Plant Model folder, the Data1 file can be defined as "..\Data\Data1.csv" (i.e. the file is located in a folder named Data that is a peer folder to the current (project) folder)

Other Examples

"..\Data1.csv" - the file is located in the parent folder of the current (project) folder

"..\..\Data1.csv" - the file is located in a folder that is two folders above the current (project) folder

"..\Data\DataSet1\Data1.csv" - the file is located in a folder named DataSet1 that is a subfolder of the the Data folder, which is a peer folder to the current (project) folder