Structure of the powerconfig file

This file is used for describing the action of the PowerConfigs when used in conjunction with mass configuration in WinCC OA, and is located in the directory <wincc_oa_path>/config. Changes made to existing PowerConfigs and new PowerConfigs created using the PowerConfig Editor are saved in this file, and then stored in the directory <proj_path>/config. This file uses the CTRL Language and is divided into a number of sections, each one describing a PowerConfig. The sections themselves also have a defined structure. Before looking at the PowerConfig Editor and the powerconfig file, you should be familiar with the Control programming language (see Introduction to CTRL). You can find more information on adding Configs/attributes using CTRL scripts in the appendix of this Help facility (see Reference tables - Data point configs).

How this file works (i.e. what happen when a PowerConfig is inserted, or when the dynamic attributes are configured at the data point) is described in the chapter How the PowerConfigs work.

A section of the powerconfig file basically has the following structure:

  • Function name()

  • Start ID

  • PowerConfig name: type for which it is valid

  • Definition of the variables used

  • dpGet() for the input variables

  • Calculation of input variables

  • Manual input

  • Calculation of output variables

  • dpSet() for the output variables

  • Default values when creating the config

  • End ID

The following script should help to clarify the structure further (definition for WinCC OA value range - _da_pv_range). Understanding this file will also make it much easier to use the PowerConfig Editor.

definition1()
{
  // definition start
  //_da_pv_range:FLOAT
  // variables definition
  anytype _max;
  anytype _min;
  // dpGet
  dpGet($DPE+":_pv_range.._min",_min,
  $DPE+":_pv_range.._max",_max);
  // calculate input
  // variables input
  //_max
  //_min
  // calculate output
  // dpSet
  dpSetWait($DPE+":_pv_range.._min",_min,
  $DPE+":_pv_range.._max",_max);
  err = getLastError();if (dynlen(err) > 0){ throwError(err);}
  // default
  dpSetWait($DPE+":_pv_range.._min",0,
  $DPE+":_pv_range.._max",100);
  // definition end
}

Editing of this file (creating new PowerConfigs, changing PowerConfigs) should be performed using the PowerConfig Editor, since automatic entries (name of the PowerConfig, plain text name for the dynamic attributes) are updated/added in the catalog file da.cat. If the file is edited using a text editor then the entries must be updated manually.

Each PowerConfig in this file has the same structure. Creating a new PowerConfig using the Editor generates another section in this file, and fills this with the parameters defined in each of the tabs in the Editor panel.