Predefined symbolic constants
Operating system used
The following Boolean constant determines which operating system is being used. This can be used in a script, for example ... if (_UNIX) ...
| Constant | Description |
|---|---|
_UNIX |
For Linux systems TRUE, for Windows FALSE. |
| _WIN32 | For Windows systems TRUE, for Linux FALSE. |
Example
main()
{
if (_UNIX)
DebugN("Running on Linux");
else if (_WIN32)
DebugN("Running on Windows");
}
Directory paths, version and current project
Absolute paths can be queried with the CTRL function getPath(). The following string constants address directories:
| Constant | Description |
|---|---|
PROJ_PATH |
Path to the project directory as defined in the file config in the directory PVSS_II. Points to the project-specific resources. CAUTION: the drive character is always uppercase. |
PVSS_PATH |
Path to the WinCC OA installation directory as also defined in the config file. CAUTION: the drive character is always uppercase. |
WINCCOA_PATH |
Identical to PVSS_PATH (see above). Path to the WinCC OA installation directory as also defined in the config file. CAUTION: the drive character is always uppercase. |
PVSS_BIN_PATH |
The PVSS_BIN_PATH constant contains the path in the WinCC OA binary directory. It is created from the WinCC OA path in the config file and "/bin/" or "/bin/". If WinCC OA programs are to be started by a control script, this should be done with system(PVSS_BIN_PATH + "WCCILxxxxx" respectively "WCCOAxxxxx"). This assures that there will not be any version conflicts if the directory is not in the current path. |
DATA_PATH |
Path to the DATA directory for the current project. The variable DATA_PATH leads to project-specific data. |
VERSION |
The constant VERSION contains the WinCC OA version as a string, for example "3.0". |
VERSION_DISP |
The new control constant VERSION_DISP shows not only the version but also the service pack number. |
VERSION_NUMERIC |
Contains the WinCC OA version in numerical form, for example 309000 for the WinCC OA version 3.9. |
PROJ |
The constant PROJ contains the current WinCC OA project (a manager runs actual with this project) as a string, for example "Testproj_de_en". Is available in CTRL and UI. |
__FILE__ |
During run-time, the constant is replaced with a string that indicates the location where it is used. In a panel's script this takes the form: [Module: <name of the module> Panel: <file name of the panel> Script: <the script where __FILE__ is referred>]. |
__FUNCTION__ |
During run-time, the constant is replaced with the name of the function in which the constant is called. |
__LINE__ |
During run-time, the constant is replaced with the value of the current line number. |
Typical runtime values
main()
{
DebugN("PROJ_PATH: " + PROJ_PATH);
DebugN("PVSS_PATH: " + PVSS_PATH);
DebugN("WINCCOA_PATH: " + WINCCOA_PATH);
DebugN("PVSS_BIN_PATH: " + PVSS_BIN_PATH);
DebugN("DATA_PATH: " + DATA_PATH);
DebugN("VERSION: " + VERSION);
DebugN("VERSION_DISP: " + VERSION_DISP);
DebugN("VERSION_NUMERIC:" + VERSION_NUMERIC);
DebugN("PROJ: " + PROJ);
}
Console output (Windows):
WCCOAui1:["PROJ_PATH: C:/Projects/MyProject/"]
WCCOAui1:["PVSS_PATH: C:/Siemens/Automation/WinCC_OA/3.20/"]
WCCOAui1:["WINCCOA_PATH: C:/Siemens/Automation/WinCC_OA/3.20/"]
WCCOAui1:["PVSS_BIN_PATH: C:/Siemens/Automation/WinCC_OA/3.20/bin/"]
WCCOAui1:["DATA_PATH: C:/Projects/MyProject/data/"]
WCCOAui1:["VERSION: 3.20"]
WCCOAui1:["VERSION_DISP: 3.20 P005"]
WCCOAui1:["VERSION_NUMERIC:320005"]
WCCOAui1:["PROJ: MyProject"]
Console output (Linux):
WCCOAui1:["PROJ_PATH: /opt/projects/MyProject/"]
WCCOAui1:["PVSS_PATH: /opt/WinCC_OA/3.20/"]
WCCOAui1:["WINCCOA_PATH: /opt/WinCC_OA/3.20/"]
WCCOAui1:["PVSS_BIN_PATH: /opt/WinCC_OA/3.20/bin/"]
WCCOAui1:["DATA_PATH: /opt/projects/MyProject/data/"]
WCCOAui1:["VERSION: 3.20"]
WCCOAui1:["VERSION_DISP: 3.20 P005"]
WCCOAui1:["VERSION_NUMERIC:320005"]
WCCOAui1:["PROJ: MyProject"]
/). Use forward slashes on all platforms. Concatenate directly: PROJ_PATH + "scripts/myScript.ctl"Standard input/output, standard error output
Use the following expressions for the function fprintf() and other functions with the data type file. Note that the result depends on your system.
| Constant | Description |
|---|---|
stdin |
Standard input |
stdout |
Standard output |
stderr |
Standard error output |
Example
main()
{
fprintf(stdout, "Normal output to console\n");
fprintf(stderr, "Error message to error output\n");
}
Borderstyles
| Constant | Value | Description |
|---|---|---|
BS_NONE |
0 | No border |
BS_3D |
1 | 3D border |
BS_SUNKEN |
2 | Sunken border |
BS_RAISED |
4 | Raised border |
BS_STYLED |
8 | Styled border using CSS |
