fwDpFunction common functions and variables
[fwDpFunction StatisticalfwDpFunction DPE Connection]

Collaboration diagram for fwDpFunction common functions and variables:

Files

file  fwDpFunction.ctl

Configuration object indexes

Used to access the configuration object attributes (object of type dyn_anytype).



const int fwDpFunction_OBJ_FUNCTION = 5
const int fwDpFunction_OBJ_PARAM = 6
const int fwDpFunction_OBJ_GLOBAL = 7
const int fwDpFunction_OBJ_TYPE = 8
const int fwDpFunction_OBJ_STAT_TYPE = 9
const int fwDpFunction_OBJ_STAT_INTERVAL = 10
const int fwDpFunction_OBJ_STAT_DELAY = 11
const int fwDpFunction_OBJ_STAT_READ_ARCHIVE = 12

Utility functions

Used to access the configuration object attributes (object of type dyn_anytype).



 fwDpFunction_objectInitialize (dyn_mixed &functionObject)
int fwDpFunction_objectExtractType (dyn_mixed functionObject)

Set/Get functions

Used to set/get the dp function settings to/from the dpe. The settings are stored into the settings object.



 fwDpFunction_deleteMultiple (dyn_string dpes, dyn_string &exceptionInfo)
 fwDpFunction_deleteMany (dyn_string dpes, dyn_string &exceptionInfo)
 fwDpFunction_delete (string dpe, dyn_string &exceptionInfo)
 fwDpFunction_objectSet (string dpe, dyn_mixed functionObject, dyn_string &exceptionInfo, bool runChecks=TRUE)
 fwDpFunction_objectSetMany (dyn_string &dpes, dyn_mixed &functionObjects, dyn_string &exceptionInfo, bool runChecks=TRUE)
 fwDpFunction_objectGet (string dpe, bool &configExists, dyn_mixed &functionObject, dyn_string &exceptionInfo)
 fwDpFunction_objectGetMany (dyn_string &dpes, dyn_bool &configExists, dyn_mixed &functionObjects, dyn_string &exceptionInfo)

Detailed Description

This is a list of variables and functions used by both fwDpFunction DPE Connection and fwDpFunction Statistical


Function Documentation

fwDpFunction_objectInitialize ( dyn_mixed &  functionObject  ) 

Initialize the dp function object with default parameters. This function is not needed if using the functions fwDpFunction_objectCreateStatistical() or fwDpFunction_objectCreateDpeConnection(). By default, the object is initialized as no dp function.

Constraints
It supports only basic parameters for statistical functions.
Usage
Public
PVSS managers
VISION, CTRL
Parameters:
functionObject This object will contain the dp function parameters with default values.
int fwDpFunction_objectExtractType ( dyn_mixed  functionObject  ) 

Return the type of dp function stored in the dp function object.

Constraints
None
Usage
Public
PVSS managers
VISION, CTRL
Parameters:
functionObject This object containing the dp function parameters.
Returns:
the type of dp function: DPCONFIG_NONE, DPCONFIG_DP_FUNCTION or DPCONFIG_STAT_FUNCTION
fwDpFunction_deleteMultiple ( dyn_string  dpes,
dyn_string &  exceptionInfo 
)

/**Deletes the DP function config for the given data point elements

Constraints
None
Usage
Public
PVSS managers
VISION, CTRL
Parameters:
dpes list of data point elements
exceptionInfo details of any errors are returned here
fwDpFunction_deleteMany ( dyn_string  dpes,
dyn_string &  exceptionInfo 
)

Deletes the DP function config for the given data point elements

Constraints
None
Usage
Public
PVSS managers
VISION, CTRL
Parameters:
dpes list of data point elements
exceptionInfo details of any errors are returned here
fwDpFunction_delete ( string  dpe,
dyn_string &  exceptionInfo 
)

Deletes the DP function config for the given data point element

Constraints
None
Usage
Public
PVSS managers
VISION, CTRL
Parameters:
dpe data point element
exceptionInfo details of any errors are returned here
fwDpFunction_objectSet ( string  dpe,
dyn_mixed  functionObject,
dyn_string &  exceptionInfo,
bool  runChecks = TRUE 
)

Set the dp-function object to the dpe

  • example: create a statistical dp function and set it to a dpe
        dyn_string exc;
        string dpe;
        //func object containing one dpfunc set
        dyn_mixed dpFuncObject;
        //dp func parameters
        dyn_string functionParams;
        dyn_string functionGlobals;
        string functionDefinition;
        dyn_int statTypes;
        int intervalS;
        int delayS;
        bool readArchive;
    
        //dp function setting:
    
        //parameters p1, p2
        dynClear(functionParams);
        dynAppend(functionParams,"sys1:dp1.val2:_original.._value");
        dynAppend(functionParams,"sys1:dp1.val3:_original.._value");
    
        //global parameters g1, g2
        dynClear(functionGlobals);
        dynAppend(functionGlobals,"sys1:dp1.val4:_original.._value");
        dynAppend(functionGlobals,"sys1:dp1.val5:_original.._value");
    
        //parameter p1 is a Maximum function, parameter p2 is an Average function
        dynClear(statTypes);
        dynAppend(statTypes,SF_MAX);
        dynAppend(statTypes,SF_AVG);
    
        //the function definition using the parameters
        functionDefinition = "p1+p2+g1+g2";
    
        //time interval
        intervalS = 3;
    
        //delay on first start
        delayS = 4;
    
        //start reading from archive
        readArchive = true;
    
        //create the func object
        fwDpFunction_objectCreateStatistical( dpFuncObject,
                                              functionParams,
                                              functionGlobals,
                                              functionDefinition,
                                              statTypes,
                                              intervalS,
                                              delayS,
                                              readArchive,
                                              exc);
    
        //dpe where to set the dp function
        dpe = "sys1:dp1.val";
    
        //set the func object to the dpe
        fwDpFunction_objectSet(dpe, dpFuncObject, exc, true);
    
Constraints
The object must be previously created with one of the functions fwDpFunction_objectCreate*
Usage
Public
PVSS managers
VISION, CTRL
Parameters:
dpe dpe to be configured with dpFunction.
functionObject This object contains the dp function parameters.
exceptionInfo Details of any exceptions are returned here
runChecks Optional parameter - default TRUE TRUE: Run consistency checks on the input to the function (HIGHLY RECOMMENDED) FALSE: Do not run any checks at all - can result in badly configured or non configured dp functions. Use only for performance reasons.
fwDpFunction_objectSetMany ( dyn_string &  dpes,
dyn_mixed &  functionObjects,
dyn_string &  exceptionInfo,
bool  runChecks = TRUE 
)

Set the dp-function object to the dpes

  • example 1: create 2 stat functions, assign them to 2 dpes:
        dyn_string exc, dpe;
        //func object containing one dpfunc set
        dyn_mixed dpFuncObject;
        //this contains all the func objects
        dyn_mixed dpFuncObjects;
        //dp func parameters
        dyn_string functionParams;
        dyn_string functionGlobals;
        string functionDefinition;
        dyn_int statTypes;
        int intervalS;
        int delayS;
        bool readArchive;
    
        //dp function settings for dpe1:
    
        //parameters p1, p2
        dynClear(functionParams);
        dynAppend(functionParams,"sys1:dp1.val2:_original.._value");
        dynAppend(functionParams,"sys1:dp1.val3:_original.._value");
    
        //global parameters g1, g2
        dynClear(functionGlobals);
        dynAppend(functionGlobals,"sys1:dp1.val4:_original.._value");
        dynAppend(functionGlobals,"sys1:dp1.val5:_original.._value");
    
        //parameter p1 is a Maximum function, parameter p2 is an Average function
        dynClear(statTypes);
        dynAppend(statTypes,SF_MAX);
        dynAppend(statTypes,SF_AVG);
    
        //the function definition using the parameters
        functionDefinition = "p1+p2+g1+g2";
    
        //time interval
        intervalS = 3;
    
        //delay on first start
        delayS = 4;
    
        //start reading from archive
        readArchive = true;
    
        //create the func object
        fwDpFunction_objectCreateStatistical( dpFuncObject,
                                              functionParams,
                                              functionGlobals,
                                              functionDefinition,
                                              statTypes,
                                              intervalS,
                                              delayS,
                                              readArchive,
                                              exc);
    
    
        //add the func object to the objects array
        dpFuncObjects[1] = dpFuncObject;
    
        //dp function settings for dpe2:
    
        //clear temp parameters
        dynClear(functionParams);
        dynClear(functionGlobals);
        dynClear(statTypes);
    
        //parameters p1, p2
        dynClear(functionParams);
        dynAppend(functionParams,"sys1:dp2.float2:_original.._value");
        dynAppend(functionParams,"sys1:dp2.float3:_original.._value");
    
        //global parameters g1, g2
        dynClear(functionGlobals);
        dynAppend(functionGlobals,"sys1:dp2.float4:_original.._value");
        dynAppend(functionGlobals,"sys1:dp2.int1:_original.._value");
    
        //parameter p1 is a Maximum function, parameter p2 is an Average function
        dynClear(statTypes);
        dynAppend(statTypes,SF_MAX);
        dynAppend(statTypes,SF_AVG);
    
        //the function definition using the parameters
        functionDefinition = "p1+p2/(g1-g2)";
    
        //time interval
        intervalS = 3;
    
        //delay on first start
        delayS = 4;
    
        //start reading from archive
        readArchive = true;
    
        //create the func object
        fwDpFunction_objectCreateStatistical( dpFuncObject,
                                              functionParams,
                                              functionGlobals,
                                              functionDefinition,
                                              statTypes,
                                              intervalS,
                                              delayS,
                                              readArchive,
                                              exc);
    
        //add the second func object to the objects array
        dpFuncObjects[2] = dpFuncObject;
    
        //list of dpes where to set the dp function
        dpe = makeDynString("sys1:dp1.val", "sys1:dp2.val");
    
        //set the func object array to the dpe array
        fwDpFunction_objectSetMany(dpe, dpFuncObjects, exc, true);
    
Constraints
The object must be previously created with one of the functions fwDpFunction_objectCreate*
Usage
Public
PVSS managers
VISION, CTRL
Parameters:
dpes List of dpes to be configured with dpFunction.
functionObjects List of function parameter objects. Each of this object contains the dp function parameters. The list lenght must be the same length as dpes. Nevertheless, if the length is 1 (i.e. only one configuration), the same configuration is applied to all the dpes. Passed as reference only for performance reasons. Not modified.
exceptionInfo Details of any exceptions are returned here
runChecks Optional parameter - default TRUE TRUE: Run consistency checks on the input to the function (HIGHLY RECOMMENDED) FALSE: Do not run any checks at all - can result in badly configured or non configured dp functions. Use only for performance reasons.
See also:
fwDpFunction_objectCreateStatistical(), fwDpFunction_objectCreateDpeConnection(), fwDpFunction_objectGetMany(), fwDpFunction_objectSet()
fwDpFunction_objectGet ( string  dpe,
bool &  configExists,
dyn_mixed &  functionObject,
dyn_string &  exceptionInfo 
)

Get the dp function settings from a single dpe

  • example 1: get a dp statistical function from a dpe and extract the settings:
        dyn_string exc;
        string dpe;
        dyn_mixed dpFuncObject;
        dyn_string functionParams;
        dyn_string functionGlobals;
        string functionDefinition;
        dyn_int statTypes;
        int intervalS;
        int delayS;
        bool readArchive;
        bool configExists;
    
        //dpe containing the dp function
        dpe = "sys1:dpe1.val";
    
        //get the dp function, store it to the dp function settings object
        fwDpFunction_objectGet(dpe, configExists, dpFuncObject, exc);
    
        //extract the statistical function settings, if it exists
        if(fwDpFunction_objectIsStatistical(dpFuncObject))
          fwDpFunction_objectExtractStatistical(dpFuncObject,
                                                functionParams,
                                                functionGlobals,
                                                functionDefinition,
                                                statTypes,
                                                intervalS,
                                                delayS,
                                                readArchive,
                                                exc);
    
        DebugN( "fwDpFunction_objectGet():",
                functionParams,
                functionGlobals,
                functionDefinition,
                statTypes,
                intervalS,
                delayS,
                readArchive,
                exc);
    
  • example 2: get a dpe connection function from a dpe and extract the settings:
        dyn_string exc;
        string dpe;
        dyn_mixed dpFuncObject;
        dyn_string functionParams;
        dyn_string functionGlobals;
        string functionDefinition;
        bool configExists;
    
        //dpe containing the dp function
        dpe = "sys1:dpe1.val";
    
        //get the dp function, store it to the dp function settings object
        fwDpFunction_objectGet(dpe, configExists, dpFuncObject, exc);
    
        //extract the statistical function settings, if it exists
        if(fwDpFunction_objectIsDpeConnection(dpFuncObject))
          fwDpFunction_objectExtractDpeConnection(dpFuncObject,
                                                functionParams,
                                                functionGlobals,
                                                functionDefinition,
                                                exc);
    
        DebugN( "fwDpFunction_objectGet():",
                functionParams,
                functionGlobals,
                functionDefinition,
                exc);
    
Constraints
None
Usage
Public
PVSS managers
VISION, CTRL
Parameters:
dpe dpe from which to extract dpFunction.
configExists True if dp config exists, false if dp config does not exist
functionObject Function parameter object to be returend.
exceptionInfo Details of any exceptions are returned here
See also:
fwDpFunction_objectCreateStatistical(), fwDpFunction_objectSet(), fwDpFunction_objectSetMany()
fwDpFunction_objectGetMany ( dyn_string &  dpes,
dyn_bool &  configExists,
dyn_mixed &  functionObjects,
dyn_string &  exceptionInfo 
)

Get the dp function settings from a list of dpes

Constraints
None
Usage
Public
PVSS managers
VISION, CTRL
Parameters:
dpes List of dpes from which to extract the dpFunction. Passed as reference only for performance reasons. Not modified.
configExists True if dp config exists, false if dp config does not exist
functionObjects List of function parameter objects to be returend.
exceptionInfo Details of any exceptions are returned here
See also:
fwDpFunction_objectGet()

Variable Documentation

Description
The function, using the parameters (will be p1 + p2...).
Parameter Type
string
Usage
Compulsory. For Dpe Connection and Statistical. See use example on fwDpFunction_OBJ_objectSet().
const int fwDpFunction_OBJ_PARAM = 6
Description
List of dpes as parameters to be used for the function (will be p1, p2...). The # of elements must be = to the # of elements in fwDpFunction_OBJ_STAT_TYPE.
Parameter Type
dyn_string
Usage

Compulsory. For Dpe Connection and Statistical. See use example on fwDpFunction_OBJ_objectSet().

const int fwDpFunction_OBJ_GLOBAL = 7
Description
List of dpes as global parameters to be used for the function (will be g1, g2...).
Parameter Type
dyn_string
Usage
Optional. For Dpe Connection and Statistical. See use example on fwDpFunction_OBJ_objectSet().
const int fwDpFunction_OBJ_TYPE = 8
Description
Type of function. Can contain the values: DPCONFIG_DP_FUNCTION, DPCONFIG_STAT_FUNCTION.
Parameter Type
int
Usage
Compulsory. For Dpe Connection and Statistical. See use example on fwDpFunction_OBJ_objectSet().
Description
Type of stat function (i.e. min, max... see full list on PVSS help, "_dp_fct.._stat_type"). One per parameter. The # of elements must be = to the # of elements in fwDpFunction_OBJ_PARAM.
Parameter Type
dyn_int
Usage
For Statistical only. Cumpulsory. Default = SF_MIN See use example on fwDpFunction_OBJ_objectSet().
Description
Time interval of stat function, in seconds
Parameter Type
int
Usage
For Statistical only. Cumpulsory. Default = 1 See use example on fwDpFunction_OBJ_objectSet().
Description
Time delay of stat function, in seconds
Parameter Type
int
Usage
For Statistical only. Optional. Default = 0 See use example on fwDpFunction_OBJ_objectSet().
Description
Read values from archive starting the stat function
Parameter Type
bool
Usage
For Statistical only. Optional. Default = false See use example on fwDpFunction_OBJ_objectSet().

Generated on 10 Dec 2015 for fwConfigs by  doxygen 1.6.1