OAProfessor

Deep OA Product Insight

User Tools

Site Tools


pathsymbolicconstants

An interesting question came up when talking with a customer and they were asking how to get directory path for various things. Check out the response:

Look in the help→CONTROL→Introduction CONTROL→Predefined symbolical constants (I already sent them a better English translation)

String 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.

You will find these are CONSTANTS. You don’t have to do anything with them, you don’t need to #uses them in a function call.

So, you can use them directly.

this.text = PVSS_PATH;
fp = fopen(PVSS_PATH + “/myfile.txt”, “r”);

The reason that you use the getPath() function is to get a file name from the project directory. Remember that you can have sub-projects, therefore a file could reside in any one of those sub-projects. So, when you make a call like:

string myfilepath = getPath(DATA_REL_PATH, “myfile.txt”);

It will look first in the current project data folder, if it cannot find it there, it goes up the sub-projects to see if it exists in one of the sub-projects in the data folder. If you look at the keywords allowed in getPath(), you will NEVER see any of the above CONSTANTS used, only relative path constants like x_REL_PATH. This example will return a fully qualified path to the file specified in the data folder of your project or subproject.

Keyword: directory

  • BIN_REL_PATH bin/
  • SOURCE_REL_PATH source/
  • HELP_REL_PATH help/
  • MSG_REL_PATH msg/
  • CONFIG_REL_PATH config/
  • PICTURES_REL_PATH pictures/
  • COLORDB_REL_PATH colorDB/
  • PANELS_REL_PATH panels/
  • IMAGES_REL_PATH images/
  • SCRIPTS_REL_PATH scripts/
  • LIBS_REL_PATH lib/
  • DATA_REL_PATH data/
  • DB_REL_PATH db/wincc_oa
  • LTA_REL_PATH lta/
  • LOG_REL_PATH log/
  • DPLIST_REL_PATH dplist/
  • NLS_REL_PATH nls/
  • PIXMAPS_REL_PATH pictures/
  • ICONS_REL_PATH pictures/
  • GIF_REL_PATH pictures/

I hope this clears it up.

pathsymbolicconstants.txt · Last modified: 2019/11/25 23:47 by toddmalone

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki