getBasePath

[ Function ]

public static getBasePath(): string;

Returns the base path for this environment. This is required to access the directory of a control, for example.

getBasePath 1:

Starting with version 1.12, control directories are no longer in a fixed location. Therefore please use the functions getControlBasePath or getControlBasePathEx to obtain the path to a control directory.

Parameter

Name

Type

Description

-

-

-

Return value

Type

Description

string

Base path of this environment. The base path is the path to the TwinCAT HMI framework directory, starting from the application directory.

getBasePath 2:

Available from 1.8

Sample - JavaScript

var fullImagePath = TcHmi.Environment.getBasePath() + '/Controls/Custom/myControl/images/myImg.png';