How the PowerConfigs work
This page gives you an overview of how the PowerConfigs work when inserted/edited in the
PARA module, when templates/DP lists are created ("ASCII out") and when edited
templates/DP lists are imported ("ASCII in") (more information on the layout and
structure of the powerconfig
file is given on the page Structure of the
powerconfig file).
PowerConfigs are defined using CTRL. The definition includes the following script sections, which are finally put together into a CTRL script as part of mass configuration, and executed using the CTRL function evalScript(). These script sections are located on the separate tabs of the PowerConfig Editor:
-
Variables - (see Variables tab)
-
Input - (see Input tab)
-
Input calculation - (see Input calculation tab)
-
Manual input - (see Manual input tab)
-
Output calculation - (see Output calculation tab)
-
Output - (see Output tab)
-
Default values - (see Default tab)
These definitions are made using the PowerConfig Editor and saved in the file. Ultimately scripts are generated from these definitions at runtime.
You should pay attention when using comments within a script in the powerconfig file (but also when editing using the different tabs of the PowerConfig Editor). The comments should begin with /* and end with */. If you add a comment by using prefixed slashes //, problems can occur when reading out the file. These problems can occur because the single sections of the file also begin with this sign.
When a PowerConfig is inserted at the master data point, a script from the following sections is executed:
-
Variables: Initialization of the defined variables.
-
Default values: Setting of the values that were configured in the Default section. These values are displayed in the configuration screen after insertion and can be changed when configuring the PowerConfig.
When the PowerConfig configuration panel opens (see PowerConfig configuration at the data point), the following steps are executed:
-
Variables : Initialization of the defined variables.
-
Input: Using dpGet(), the configured values are retrieved from the Event Manager and written to the variables.
-
Input calculation: Before displaying the values in the configuration panel, an optional calculation can be performed on them.
-
Manual input: The user can subsequently alter all the dynamic attributes that are displayed in the configuration panel.
-
Clicking on OK in the configuration panel assigns the set values to the variables.
-
Output calculation : An optional calculation can be performed in this step before the values are set.
-
Output: The values are set by means of dpSetWait().
The following steps are performed for an "ASCII out":
-
Variables : Initialization of the defined variables.
-
Input: Using dpGet(), the configured values are retrieved from the database and written to the variables.
-
Input calculation : Before exporting the values into an ASCII file, an optional calculation can be performed on them.
-
Manual input : Only the dynamic attributes, which can be amended later, are included in the export into an ASCII file.
The following steps are performed for an "ASCII in":
-
Variables : Initialization of the defined variables.
-
Input: Using dpGet(), the configured values are retrieved from the Event Manager and written to the variables.
-
Input calculation : An optional computation can be performed on the values before further processing.
-
Manual input : The dynamic attributes have already been changed in the ASCII file in this case.
-
The variables are supplied with the values defined from the file or with the values retrieved from the Event Manager.
-
Output calculation : An optional calculation can be performed in this step before the values are set.
-
Output : The values are set by means of dpSetWait().
All the definitions for a PowerConfig are set in the specific tabs of the dedicated Editor. The following pages describe the functions of each of the tabs.