This library contains functions called from other unCPC scripts. More...
Functions | |
void | cpcConfigGenericFunctions_checkDeviceConfig (string deviceType, dyn_string dsConfigs, dyn_string &exceptionInfo) |
void | cpcConfigGenericFunctions_checkBool (string name, string source, bool &bRes, dyn_string &exceptionInfo) |
void | cpcConfigGenericFunctions_checkDescription (dyn_string dsConfigs, string sLabels, dyn_string &exceptionInfo) |
void | cpcConfigGenericFunctions_checkFormat (string sFormat, dyn_string &exceptionInfo) |
bool | cpcConfigGenericFunctions_checkConfigLength (string deviceType, dyn_string dsConfigs, bool &bHasArchive) |
void | cpcConfigGenericFunctions_checkArchiveConfig (string deviceType, dyn_string &dsConfigs, dyn_string &exceptionInfo) |
void | cpcConfigGenericFunctions_checkDeviceAddress (dyn_string dsConfigs, string plcType, string deviceType, string addressName, mapping addrProps, bool bHasArchive, dyn_string &exceptionInfo) |
void | cpcConfigGenericFunctions_checkAddressCMW (string address, dyn_string &exceptionInfo) |
void | cpcConfigGenericFunctions_check5RangesAlert (dyn_string dsConfigs, int alarmActivePos, dyn_int diLimits, dyn_string &exceptionInfo) |
void | cpcConfigGenericFunctions_checkParameters (string deviceType, string parameters, dyn_string &exceptionInfo) |
void | cpcConfigGenericFunctions_setDeviceConfig (dyn_string dsConfigs, dyn_string &exceptionInfo) |
void | cpcConfigGenericFunctions_setDPEAlias (string deviceName, string dpe, dyn_string &exceptionInfo) |
void | cpcConfigGenericFunctions_setDescription (dyn_string dsConfigs, string deviceType, string regName, mapping regProperties, string plcType, bool bHasArchive, dyn_string &exceptionInfo) |
void | cpcConfigGenericFunctions_setUnit (dyn_string dsConfigs, string deviceType, string regName, mapping regProperties, string plcType, bool bHasArchive, dyn_string &exceptionInfo) |
void | cpcConfigGenericFunctions_setFormat (dyn_string dsConfigs, string deviceType, string regName, mapping regProperties, string plcType, bool bHasArchive, dyn_string &exceptionInfo) |
void | cpcConfigGenericFunctions_getRange (dyn_string dsConfigs, string deviceType, string regName, string &rangeMax, string &rangeMin, bool bHasArchive) |
void | cpcConfigGenericFunctions_setRange (dyn_string dsConfigs, string deviceType, string regName, mapping regProperties, string plcType, bool bHasArchive, dyn_string &exceptionInfo) |
void | cpcConfigGenericFunctions_setParameters (string deviceType, dyn_string dsConfigs, string parameters, dyn_string &exceptionInfo) |
void | cpcConfigGenericFunctions_setMetainfo (string deviceType, dyn_string dsConfigs, bool hasArchive, dyn_string &exceptionInfo) |
void | cpcConfigGenericFunctions_setSmoothing (dyn_string dsConfigs, string deviceType, string regName, mapping regProperties, string plcType, bool bHasArchive, dyn_string &exceptionInfo) |
void | cpcConfigGenericFunctions_setArchive (dyn_string dsConfigs, string deviceType, string regName, mapping regProperties, string plcType, bool bHasArchive, dyn_string &exceptionInfo) |
void | cpcConfigGenericFunctions_setEvArchive (dyn_string dsConfigs, string address, dyn_string &exceptionInfo) |
void | cpcConfigGenericFunctions_setMaskEvent (string deviceType, string deviceName, bool isMasked, dyn_string &exceptionInfo) |
void | cpcConfigGenericFunctions_setAddress (dyn_string dsConfigs, string regName, mapping regProperties, int regPosition, string plcType, dyn_string &exceptionInfo) |
void | cpcConfigGenericFunctions_setCMWAddress (string dpeName, string addressReference, string driverReference, dyn_string &exceptionInfo) |
void | cpcConfigGenericFunctions_setAlert (dyn_string dsConfigs, string deviceType, string alertName, mapping alertProps, string plcType, string regName, dyn_string &exceptionInfo) |
void | cpcConfigGenericFunctions_setAlertDetails (dyn_string dsConfigs, string deviceType, string alertName, mapping alertProps, string plcType, string regName, dyn_string &exceptionInfo) |
void | cpcConfigGenericFunctions_setDigitalAlert (string sDpName, dyn_string dsdescription, dyn_string dsAlertTexts, dyn_string dsAlertClasses, bool bOkRange, bool active, bool bSMS, dyn_string &exceptionInfo) |
void | cpcConfigGenericFunctions_set5RangesAlert (dyn_string dsConfigs, string sDp, string description, bool acknowledgeAlarm, bool alarmActive, bool bSMS, dyn_int diLimits, dyn_string &exceptionInfo) |
void | cpcConfigGenericFunctions_get5AlertConfig (string LLparam, string Lparam, string Hparam, string HHparam, bool bSMS, bool acknowledgeAlarm, dyn_float &dfLevelLimits, dyn_string &dsLevelsAlarm, dyn_string &dsLevelsAlertsClass) |
string | cpcConfigGenericFunctions_getAlertClass (bool acknowledgeAlarm, bool bSMS, string postfix="") |
dyn_string | cpcConfigGenericFunctions_getDeviceParamNames (string deviceType) |
mapping | cpcConfigGenericFunctions_getDPEConfig (string deviceType) |
int | cpcConfigGenericFunctions_getConstant (string deviceType, string constantName) |
int | cpcConfigGenericFunctions_getConstantDPEAdress (string deviceType, string address) |
int | cpcConfigGenericFunctions_getConstantDPEProperty (string deviceType, string addrName, bool hasArchive, string propName) |
int | cpcConfigGenericFunctions_getConstantDPLength (string deviceType) |
int | cpcConfigGenericFunctions_getConstantDPAdditionalLength (string deviceType) |
anytype | cpcConfigGenericFunctions_getConstantByName (string name) |
string | cpcConfigGenericFunctions_getStringConstantByName (string name) |
string | cpcConfigGenericFunctions_getShortTypeName (string deviceType) |
string | cpcConfigGenericFunctions_getConstantPrefix (string plcType) |
string | cpcConfigGenericFunctions_getFrontEndType () |
int | cpcConfigGenericFunctions_translateDataType (string plcType, int commonDataType) |
int | cpcConfigGenericFunctions_translateDataTypeForS7Check (int commonDataType) |
dyn_string | splitCommaSeparatedString (string data) |
void | cpcConfigGenericFunctions_processArchives (int iToSkip, bool hasArchive, dyn_string &dsConfigs) |
This library contains functions called from other unCPC scripts.
©Copyright CERN 2013 - all rights reserved
10/10/2012: Alexey refactor function names and update documentation
26/07/2012: Alexey [UCPC-920] store alert dpes in mail/sms categories instead of dp
16/05/2012: Alexey [UCPC-787] AlSt always acknowledgeable
27/03/2012: Alexey [UCPC-733] removed hook for custom PCO interlocks
23/03/2012: Alexey [UCPC-723] modify cpcConfigGenericFunctions_setAlertDetails in order to have interlocks always acknowledgable
20/01/2012: Alexey check archive filter only when it's found
12/12/2011: Alexey [UCPC-621] modified alarm setting procedure
21/10/2011: Alexey fixed consistence checking of cpcConfigGenericFunctions_check5RangesAlert
03/10/2011: Alexey [UCPC-562] updated 5alert processing - removed normal position from AI/AO
16/09/2011: Alexey [UCPC-525] removed hasMaskEvent properties refactored cpcConfigGenericFunctions_setMaskEvent - made it generic
14/09/2011: Alexey [UCPC-524] strip metainfo data after split
02/09/2011: Alexey boolean dpe always with old/new archive/smoothing
08/08/2011: Alexey allow to create not-alarm bool dpe
02/08/2011: Alexey [UCPC-437] H/L thresholds never ack
28/07/2011: Alexey [UCPC-423] fixed masking event on the importation stage
28/07/2011: Alexey [UCPC-436] store sms message
14/07/2011: Alexey introduced stubAlarm parameter
08/07/2011: Alexey [UCPC-384] removed "parameters" field from the meta-info block
06/07/2011: Alexey [UCPC-336] in cpcConfigGenericFunctions_setSmoothing use straight deadband value (removed range reference)
01/07/2011: Alexey [UCPC-364] check params before import
2011/05/30 Alexey added cpcConfigGenericFunctions_getStringConstantValueByName
2011/05/30 Alexey [UCPC-292] moved meta-info to the end of config line; removed UN_CPC_CONFIG length constants
2011/05/10 amerezhi [IS-527] process metainfo with API [UCPC-268] added second ALIAS
2011/05/09 amerezhi [UCPC-235] added metainfo (types relationships configuraiton) used CPC length constants - UN_CPC_CONFIG_ALLCOMMON_LENGTH and UN_CPC_CONFIG_COMMON_LENGTH ported unConfigGenericFunctions_check5RangesAlert to cpcConfigGenericFunctions_check5RangesAlert to use CPC length constants
21/04/2011: amerezhi [UCPC-262] fixed configuring alarm for S7
21/04/2011: amerezhi added alarm acknowledge and 5 range alarm support
13/04/2011: amerezhi updated SMS_CATEGORIES processing according new API [IS-518]
11/04/2011: amerezhi
07/04/2011: amerezhi
05/04/2011: amerezhi
28/03/2011: amerezhi
Revision 1.20 2010/09/17 16:33:00 amerezhi The cpcConfigGenericFunctions_checkDescription is fixed
Revision 1.19 2008/09/04 14:48:54 gthomas -moved back to version 1.17
Revision 1.18 2008/06/18 14:54:51 aabadz Changes done following the recomendations from AB-CO (from Herve)
Revision 1.17 2007/11/27 10:47:11 ikoblik Tested + bug fixes according to the November, 21st code review.
Revision 1.16 2007/11/26 16:09:49 ikoblik Small bug fixes to getPlcDpName
Revision 1.15 2007/11/22 10:04:33 gamx cpcConfigGenericFunctions_getPlcDpName is added
Revision 1.14 2007/11/15 08:38:52 ikoblik cpcConfigGenericFunctions code review comments implemented and tested for syntax errors
Revision 1.13 2007/11/14 15:33:07 ikoblik cpcConfigGenericFunctions code review comments implementation
Revision 1.12 2007/10/30 16:19:51 gthomas Introduced the CVS keyword $Log to track changes made in the library
void cpcConfigGenericFunctions_checkDeviceConfig | ( | string | deviceType, | |
dyn_string | dsConfigs, | |||
dyn_string & | exceptionInfo | |||
) |
Generic function that check device config.
Check validness of importation line using getConfig(), getParamNames() functions and importation constants defined in the device config script.
deviceType | device type | |
dsConfigs | importation line, processed in the unCore | |
exceptionInfo | exception info |
References CPC_BOOL, CPC_CMW_DPTYPE, cpcConfigGenericFunctions_check5RangesAlert(), cpcConfigGenericFunctions_checkAddressCMW(), cpcConfigGenericFunctions_checkArchiveConfig(), cpcConfigGenericFunctions_checkBool(), cpcConfigGenericFunctions_checkConfigLength(), cpcConfigGenericFunctions_checkDescription(), cpcConfigGenericFunctions_checkDeviceAddress(), cpcConfigGenericFunctions_checkFormat(), cpcConfigGenericFunctions_checkParameters(), cpcConfigGenericFunctions_getConstant(), cpcConfigGenericFunctions_getConstantDPAdditionalLength(), cpcConfigGenericFunctions_getConstantDPEAdress(), cpcConfigGenericFunctions_getConstantDPEProperty(), cpcConfigGenericFunctions_getConstantDPLength(), cpcConfigGenericFunctions_getDPEConfig(), cpcConfigGenericFunctions_getFrontEndType(), and cpcConfigGenericFunctions_getShortTypeName().
Referenced by _UnPlc_CPC_AnaDig_checkConfig(), _UnPlc_CPC_AnaDO_checkConfig(), _UnPlc_CPC_Analog_checkConfig(), _UnPlc_CPC_AnalogAlarm_checkConfig(), _UnPlc_CPC_AnalogInput_checkConfig(), _UnPlc_CPC_AnalogOutput_checkConfig(), _UnPlc_CPC_AnalogParameter_checkConfig(), _UnPlc_CPC_AnalogStatus_checkConfig(), _UnPlc_CPC_Controller_checkConfig(), _UnPlc_CPC_DigitalAlarm_checkConfig(), _UnPlc_CPC_DigitalInput_checkConfig(), _UnPlc_CPC_DigitalOutput_checkConfig(), _UnPlc_CPC_DigitalParameter_checkConfig(), _UnPlc_CPC_Local_checkConfig(), _UnPlc_CPC_MassFlowController_checkConfig(), _UnPlc_CPC_OnOff_checkConfig(), _UnPlc_CPC_ProcessControlObject_checkConfig(), _UnPlc_CPC_Word2AnalogStatus_checkConfig(), _UnPlc_CPC_WordParameter_checkConfig(), _UnPlc_CPC_WordStatus_checkConfig(), CMW_CPC_AnalogInput_checkConfig(), CMW_CPC_AnalogStatus_checkConfig(), CMW_CPC_DigitalInput_checkConfig(), CMW_CPC_WordStatus_checkConfig(), S7_PLC_CPC_AnaDig_checkConfig(), S7_PLC_CPC_AnaDO_checkConfig(), S7_PLC_CPC_Analog_checkConfig(), S7_PLC_CPC_AnalogAlarm_checkConfig(), S7_PLC_CPC_AnalogInput_checkConfig(), S7_PLC_CPC_AnalogOutput_checkConfig(), S7_PLC_CPC_AnalogParameter_checkConfig(), S7_PLC_CPC_AnalogStatus_checkConfig(), S7_PLC_CPC_Controller_checkConfig(), S7_PLC_CPC_DigitalAlarm_checkConfig(), S7_PLC_CPC_DigitalInput_checkConfig(), S7_PLC_CPC_DigitalOutput_checkConfig(), S7_PLC_CPC_DigitalParameter_checkConfig(), S7_PLC_CPC_Local_checkConfig(), S7_PLC_CPC_MassFlowController_checkConfig(), S7_PLC_CPC_OnOff_checkConfig(), S7_PLC_CPC_ProcessControlObject_checkConfig(), S7_PLC_CPC_Word2AnalogStatus_checkConfig(), S7_PLC_CPC_WordParameter_checkConfig(), S7_PLC_CPC_WordStatus_checkConfig(), SOFT_FE_CPC_AnalogInput_checkConfig(), SOFT_FE_CPC_AnalogParameter_checkConfig(), SOFT_FE_CPC_AnalogStatus_checkConfig(), SOFT_FE_CPC_DigitalInput_checkConfig(), SOFT_FE_CPC_DigitalParameter_checkConfig(), and SOFT_FE_CPC_WordStatus_checkConfig().
void cpcConfigGenericFunctions_checkBool | ( | string | name, | |
string | source, | |||
bool & | bRes, | |||
dyn_string & | exceptionInfo | |||
) |
Check if string represents a boolean value.
name | name of the field, used in error message | |
source | string to check | |
bRes | boolean representation of the string | |
exceptionInfo | exception info |
Referenced by CPC_DigitalParameterConfig_checkCustomConfig(), CPC_DigitalParameterConfig_setCustomConfig(), cpcConfigGenericFunctions_check5RangesAlert(), cpcConfigGenericFunctions_checkDeviceConfig(), cpcConfigGenericFunctions_setAlertDetails(), and cpcConfigGenericFunctions_setDeviceConfig().
void cpcConfigGenericFunctions_checkDescription | ( | dyn_string | dsConfigs, | |
string | sLabels, | |||
dyn_string & | exceptionInfo | |||
) |
Check comma separated string for the correctness.
Verifies that each of the values is a pair of an identifier, assignment sign, and an integer as a value. For example: "value1=23,value2=10"
dsConfigs | importation line, processed in the unCore | |
sLabels | string to test that contains comma separated values | |
exceptionInfo | exception info |
References CPC_CONFIG_EMPTY_DESCRIPTION_STRING.
Referenced by cpcConfigGenericFunctions_checkDeviceConfig().
void cpcConfigGenericFunctions_checkFormat | ( | string | sFormat, | |
dyn_string & | exceptionInfo | |||
) |
Check if format is correct
sFormat | format value to check | |
exceptionInfo | exception info |
Referenced by cpcConfigGenericFunctions_checkDeviceConfig().
bool cpcConfigGenericFunctions_checkConfigLength | ( | string | deviceType, | |
dyn_string | dsConfigs, | |||
bool & | bHasArchive | |||
) |
Check if the configs lenght is correct. Also reports if config has archiving in it.
deviceType | DPT name | |
dsConfigs | importation line, processed in the unCore | |
bHasArchive | set to true if passed config importation line contains bool/analog/event archives, otherwise set to false |
References cpcConfigGenericFunctions_getConstantDPAdditionalLength(), and cpcConfigGenericFunctions_getConstantDPLength().
Referenced by cpcConfigGenericFunctions_checkDeviceConfig().
void cpcConfigGenericFunctions_checkArchiveConfig | ( | string | deviceType, | |
dyn_string & | dsConfigs, | |||
dyn_string & | exceptionInfo | |||
) |
Checks archive names for correctness.
Archives should be defined in passing importation line. Proxy validation to unConfigGenericFunctions_checkArchive.
deviceType | DPT name | |
dsConfigs | importation line, processed in the unCore | |
exceptionInfo | exception info |
References cpcConfigGenericFunctions_getConstantDPAdditionalLength(), and cpcConfigGenericFunctions_getConstantDPLength().
Referenced by cpcConfigGenericFunctions_checkDeviceConfig().
void cpcConfigGenericFunctions_checkDeviceAddress | ( | dyn_string | dsConfigs, | |
string | plcType, | |||
string | deviceType, | |||
string | addressName, | |||
mapping | addrProps, | |||
bool | bHasArchive, | |||
dyn_string & | exceptionInfo | |||
) |
Check device address
dsConfigs | importation line, processed in the unCore | |
plcType | current plc type | |
deviceType | device type | |
addressName | dpe name (should be the key in getConfig() mapping) | |
addrProps | checked address properties | |
bHasArchive | does importation line contain bool/analog/event archives | |
exceptionInfo | exception info |
References CPC_CMW_DPTYPE, cpcConfigGenericFunctions_checkAddressCMW(), cpcConfigGenericFunctions_getConstantDPEAdress(), and cpcConfigGenericFunctions_translateDataTypeForS7Check().
Referenced by cpcConfigGenericFunctions_checkDeviceConfig().
void cpcConfigGenericFunctions_checkAddressCMW | ( | string | address, | |
dyn_string & | exceptionInfo | |||
) |
Check if CMW address is correctly formered. It's allows to have an emtpy string for address.
address | address string | |
exceptionInfo | exception info |
References CPC_CMW_ADDRESS_CONFIG_SEPARATOR.
Referenced by cpcConfigGenericFunctions_checkDeviceAddress(), and cpcConfigGenericFunctions_checkDeviceConfig().
void cpcConfigGenericFunctions_check5RangesAlert | ( | dyn_string | dsConfigs, | |
int | alarmActivePos, | |||
dyn_int | diLimits, | |||
dyn_string & | exceptionInfo | |||
) |
Check 5 ranges _alert_hdl data.
dsConfigs | importation line, processed in the unCore | |
alarmActivePos | position of alarm active field in the importation line; device's importation constant should be used. | |
diLimits | positions of 4 limits - LL,L,H,HH - in the importation line; device's importation constant should be used. | |
exceptionInfo | exception info |
References cpcConfigGenericFunctions_checkBool().
Referenced by cpcConfigGenericFunctions_checkDeviceConfig().
void cpcConfigGenericFunctions_checkParameters | ( | string | deviceType, | |
string | parameters, | |||
dyn_string & | exceptionInfo | |||
) |
Check device parameters field.
Parameters is the special field of importation line that should be presented as a KEY=VALUE comma separated list. Parameters should contains all and the only keys that defined in device' getParamNames function.
deviceType | importation line, processed in the unCore | |
parameters | parameters value | |
exceptionInfo | exception info |
References cpcConfigGenericFunctions_getDeviceParamNames().
Referenced by cpcConfigGenericFunctions_checkDeviceConfig().
void cpcConfigGenericFunctions_setDeviceConfig | ( | dyn_string | dsConfigs, | |
dyn_string & | exceptionInfo | |||
) |
Generic function that set device config. Set up device's dpes using getConfig(), getParamNames() functions and importation constants defined in the device config script.
dsConfigs | importation line, processed in the unCore | |
exceptionInfo | exception info |
References CPC_BOOL, CPC_CMW_DPTYPE, CPC_CONFIG_SMS_MESSAGE, cpcConfigGenericFunctions_checkBool(), cpcConfigGenericFunctions_getConstant(), cpcConfigGenericFunctions_getConstantDPAdditionalLength(), cpcConfigGenericFunctions_getConstantDPEAdress(), cpcConfigGenericFunctions_getConstantDPEProperty(), cpcConfigGenericFunctions_getConstantDPLength(), cpcConfigGenericFunctions_getDPEConfig(), cpcConfigGenericFunctions_getFrontEndType(), cpcConfigGenericFunctions_getShortTypeName(), cpcConfigGenericFunctions_processArchives(), cpcConfigGenericFunctions_set5RangesAlert(), cpcConfigGenericFunctions_setAddress(), cpcConfigGenericFunctions_setAlert(), cpcConfigGenericFunctions_setAlertDetails(), cpcConfigGenericFunctions_setArchive(), cpcConfigGenericFunctions_setDescription(), cpcConfigGenericFunctions_setDPEAlias(), cpcConfigGenericFunctions_setEvArchive(), cpcConfigGenericFunctions_setFormat(), cpcConfigGenericFunctions_setMaskEvent(), cpcConfigGenericFunctions_setMetainfo(), cpcConfigGenericFunctions_setParameters(), cpcConfigGenericFunctions_setRange(), cpcConfigGenericFunctions_setSmoothing(), and cpcConfigGenericFunctions_setUnit().
Referenced by _UnPlc_CPC_AnaDig_setConfig(), _UnPlc_CPC_AnaDO_setConfig(), _UnPlc_CPC_Analog_setConfig(), _UnPlc_CPC_AnalogAlarm_setConfig(), _UnPlc_CPC_AnalogInput_setConfig(), _UnPlc_CPC_AnalogOutput_setConfig(), _UnPlc_CPC_AnalogParameter_setConfig(), _UnPlc_CPC_AnalogStatus_setConfig(), _UnPlc_CPC_Controller_setConfig(), _UnPlc_CPC_DigitalAlarm_setConfig(), _UnPlc_CPC_DigitalInput_setConfig(), _UnPlc_CPC_DigitalOutput_setConfig(), _UnPlc_CPC_DigitalParameter_setConfig(), _UnPlc_CPC_Local_setConfig(), _UnPlc_CPC_MassFlowController_setConfig(), _UnPlc_CPC_OnOff_setConfig(), _UnPlc_CPC_ProcessControlObject_setConfig(), _UnPlc_CPC_Word2AnalogStatus_setConfig(), _UnPlc_CPC_WordParameter_setConfig(), _UnPlc_CPC_WordStatus_setConfig(), CMW_CPC_AnalogInput_setConfig(), CMW_CPC_AnalogStatus_setConfig(), CMW_CPC_DigitalInput_setConfig(), CMW_CPC_WordStatus_setConfig(), S7_PLC_CPC_AnaDig_setConfig(), S7_PLC_CPC_AnaDO_setConfig(), S7_PLC_CPC_Analog_setConfig(), S7_PLC_CPC_AnalogAlarm_setConfig(), S7_PLC_CPC_AnalogInput_setConfig(), S7_PLC_CPC_AnalogOutput_setConfig(), S7_PLC_CPC_AnalogParameter_setConfig(), S7_PLC_CPC_AnalogStatus_setConfig(), S7_PLC_CPC_Controller_setConfig(), S7_PLC_CPC_DigitalAlarm_setConfig(), S7_PLC_CPC_DigitalInput_setConfig(), S7_PLC_CPC_DigitalOutput_setConfig(), S7_PLC_CPC_DigitalParameter_setConfig(), S7_PLC_CPC_Local_setConfig(), S7_PLC_CPC_MassFlowController_setConfig(), S7_PLC_CPC_OnOff_setConfig(), S7_PLC_CPC_ProcessControlObject_setConfig(), S7_PLC_CPC_Word2AnalogStatus_setConfig(), S7_PLC_CPC_WordParameter_setConfig(), S7_PLC_CPC_WordStatus_setConfig(), SOFT_FE_CPC_AnalogInput_setConfig(), SOFT_FE_CPC_AnalogParameter_setConfig(), SOFT_FE_CPC_AnalogStatus_setConfig(), SOFT_FE_CPC_DigitalInput_setConfig(), SOFT_FE_CPC_DigitalParameter_setConfig(), and SOFT_FE_CPC_WordStatus_setConfig().
void cpcConfigGenericFunctions_setDPEAlias | ( | string | deviceName, | |
string | dpe, | |||
dyn_string & | exceptionInfo | |||
) |
Set DPE alias to alias%.dpe_name% (e.g. "object1.PosSt")
deviceName | device name (alias) | |
dpe | full dpe name (e.g. dist_1:un-PLCATLTRT-ATLTRT-CPC_AnalogParameter-00001.ProcessInput.PosSt) | |
exceptionInfo | exception info |
Referenced by cpcConfigGenericFunctions_setDeviceConfig().
void cpcConfigGenericFunctions_setDescription | ( | dyn_string | dsConfigs, | |
string | deviceType, | |||
string | regName, | |||
mapping | regProperties, | |||
string | plcType, | |||
bool | bHasArchive, | |||
dyn_string & | exceptionInfo | |||
) |
Set description for the given element (dpe)
dsConfigs | importation line, processed in the unCore | |
deviceType | device type | |
regName | dpe name | |
regProperties | dpe properties | |
plcType | current plc type | |
bHasArchive | does importation line contain bool/analog/event archives | |
exceptionInfo | exception info |
References CPC_CONFIG_EMPTY_DESCRIPTION_STRING, and cpcConfigGenericFunctions_getConstantDPEProperty().
Referenced by cpcConfigGenericFunctions_setDeviceConfig().
void cpcConfigGenericFunctions_setUnit | ( | dyn_string | dsConfigs, | |
string | deviceType, | |||
string | regName, | |||
mapping | regProperties, | |||
string | plcType, | |||
bool | bHasArchive, | |||
dyn_string & | exceptionInfo | |||
) |
Set unit for the given element (dpe)
dsConfigs | importation line, processed in the unCore | |
deviceType | device type | |
regName | dpe name | |
regProperties | dpe properties | |
plcType | current plc type | |
bHasArchive | does importation line contain bool/analog/event archives | |
exceptionInfo | exception info |
References cpcConfigGenericFunctions_getConstantDPEProperty().
Referenced by cpcConfigGenericFunctions_setDeviceConfig().
void cpcConfigGenericFunctions_setFormat | ( | dyn_string | dsConfigs, | |
string | deviceType, | |||
string | regName, | |||
mapping | regProperties, | |||
string | plcType, | |||
bool | bHasArchive, | |||
dyn_string & | exceptionInfo | |||
) |
Set format for the given element (dpe)
dsConfigs | importation line, processed in the unCore | |
deviceType | device type | |
regName | dpe name | |
regProperties | dpe properties | |
plcType | current plc type | |
bHasArchive | does importation line contain bool/analog/event archives | |
exceptionInfo | exception info |
References cpcConfigGenericFunctions_getConstantDPEProperty().
Referenced by cpcConfigGenericFunctions_setDeviceConfig().
void cpcConfigGenericFunctions_getRange | ( | dyn_string | dsConfigs, | |
string | deviceType, | |||
string | regName, | |||
string & | rangeMax, | |||
string & | rangeMin, | |||
bool | bHasArchive | |||
) |
Init range from importation line
dsConfigs | importation line, processed in the unCore | |
deviceType | device type | |
regName | dpe name | |
rangeMax | max range to set | |
rangeMin | min range to set | |
bHasArchive | does importation line contain bool/analog/event archives |
References cpcConfigGenericFunctions_getConstantDPEProperty().
Referenced by cpcConfigGenericFunctions_setRange().
void cpcConfigGenericFunctions_setRange | ( | dyn_string | dsConfigs, | |
string | deviceType, | |||
string | regName, | |||
mapping | regProperties, | |||
string | plcType, | |||
bool | bHasArchive, | |||
dyn_string & | exceptionInfo | |||
) |
Set range for the given element (dpe)
dsConfigs | importation line, processed in the unCore | |
deviceType | device type | |
regName | dpe name | |
regProperties | dpe properties | |
plcType | current plc type | |
bHasArchive | does importation line contain bool/analog/event archives | |
exceptionInfo | exception info |
References cpcConfigGenericFunctions_getRange().
Referenced by cpcConfigGenericFunctions_setDeviceConfig().
void cpcConfigGenericFunctions_setParameters | ( | string | deviceType, | |
dyn_string | dsConfigs, | |||
string | parameters, | |||
dyn_string & | exceptionInfo | |||
) |
Set parameters for the given element (dpe)
deviceType | device type | |
dsConfigs | importation line, processed in the unCore | |
parameters | parameters value | |
exceptionInfo | exception info |
References cpcGenericDpFunctions_setDeviceProperty().
Referenced by cpcConfigGenericFunctions_setDeviceConfig().
void cpcConfigGenericFunctions_setMetainfo | ( | string | deviceType, | |
dyn_string | dsConfigs, | |||
bool | hasArchive, | |||
dyn_string & | exceptionInfo | |||
) |
Set meta info for the given element (dpe)
Meta info is device's heirarchy (i.e. master/parents/children), type and second alias
deviceType | device type | |
dsConfigs | importation line, processed in the unCore | |
hasArchive | does importation line contain bool/analog/event archives | |
exceptionInfo | exception info |
References CPC_CONFIG_CHILDREN_KEY, CPC_CONFIG_MASTER_NAME_KEY, CPC_CONFIG_PARENTS_KEY, CPC_CONFIG_SECOND_ALIAS_KEY, CPC_CONFIG_TYPE_KEY, cpcConfigGenericFunctions_getConstantDPEProperty(), and splitCommaSeparatedString().
Referenced by cpcConfigGenericFunctions_setDeviceConfig().
void cpcConfigGenericFunctions_setSmoothing | ( | dyn_string | dsConfigs, | |
string | deviceType, | |||
string | regName, | |||
mapping | regProperties, | |||
string | plcType, | |||
bool | bHasArchive, | |||
dyn_string & | exceptionInfo | |||
) |
Set deadband for the given element (dpe)
Deadband could be absolute, relative, old/new comparison and none.
dsConfigs | importation line, processed in the unCore | |
deviceType | device type | |
regName | dpe name | |
regProperties | dpe properties | |
plcType | current plc type | |
bHasArchive | does importation line contain bool/analog/event archives | |
exceptionInfo | exception info |
References cpcConfigGenericFunctions_getConstantDPEProperty().
Referenced by cpcConfigGenericFunctions_setDeviceConfig().
void cpcConfigGenericFunctions_setArchive | ( | dyn_string | dsConfigs, | |
string | deviceType, | |||
string | regName, | |||
mapping | regProperties, | |||
string | plcType, | |||
bool | bHasArchive, | |||
dyn_string & | exceptionInfo | |||
) |
Set archiving for the given element (dpe)
For analog dpes archive parameters (including smoothing) are coded in ARCHIVE_ACTIVE and ARCHIVE_TIME_FILTER (optional) fields. For boolean dpes it's always old/new smooth, ARCHIVE_ACTIVE is treated only as "yes" or "no".
dsConfigs | importation line, processed in the unCore | |
deviceType | device type | |
regName | dpe name | |
regProperties | dpe properties | |
plcType | current plc type | |
bHasArchive | does importation line contain bool/analog/event archives | |
exceptionInfo | exception info |
References CPC_BOOL, and cpcConfigGenericFunctions_getConstantDPEProperty().
Referenced by cpcConfigGenericFunctions_setDeviceConfig().
void cpcConfigGenericFunctions_setEvArchive | ( | dyn_string | dsConfigs, | |
string | address, | |||
dyn_string & | exceptionInfo | |||
) |
Set archiving for the device event dpes
The event dpe's archiving is always configured with old/new smoothing.
dsConfigs | importation line, processed in the unCore | |
address | dpe name | |
exceptionInfo | exception info |
Referenced by cpcConfigGenericFunctions_setDeviceConfig().
void cpcConfigGenericFunctions_setMaskEvent | ( | string | deviceType, | |
string | deviceName, | |||
bool | isMasked, | |||
dyn_string & | exceptionInfo | |||
) |
Set mask state for the given device
deviceType | device type | |
deviceName | device name | |
isMasked | mask state to set | |
exceptionInfo | exception info |
References CPC_BOOL, and cpcConfigGenericFunctions_getDPEConfig().
Referenced by cpcConfigGenericFunctions_setDeviceConfig(), and cpcGenericObject_HandleUnicosMenu().
void cpcConfigGenericFunctions_setAddress | ( | dyn_string | dsConfigs, | |
string | regName, | |||
mapping | regProperties, | |||
int | regPosition, | |||
string | plcType, | |||
dyn_string & | exceptionInfo | |||
) |
Set address for the given element (dpe)
Set up periphery address for S7 or UNICOS (Schneider)
dsConfigs | importation line, processed in the unCore | |
regName | dpe name | |
regProperties | dpe properties | |
regPosition | adress position in the importation line | |
plcType | current plc type | |
exceptionInfo | exception info |
References CPC_CMW_DPTYPE, cpcConfigGenericFunctions_setCMWAddress(), and cpcConfigGenericFunctions_translateDataType().
Referenced by cpcConfigGenericFunctions_setDeviceConfig().
void cpcConfigGenericFunctions_setCMWAddress | ( | string | dpeName, | |
string | addressReference, | |||
string | driverReference, | |||
dyn_string & | exceptionInfo | |||
) |
Set up CMW address config
dpeName | dpe name | |
addressReference | address configuration in the importation line | |
driverReference | driver reference | |
exceptionInfo | exception info |
References CPC_CMW_ADDRESS_CONFIG_SEPARATOR.
Referenced by cpcConfigGenericFunctions_setAddress(), and cpcConfigGenericFunctions_setAlert().
void cpcConfigGenericFunctions_setAlert | ( | dyn_string | dsConfigs, | |
string | deviceType, | |||
string | alertName, | |||
mapping | alertProps, | |||
string | plcType, | |||
string | regName, | |||
dyn_string & | exceptionInfo | |||
) |
Set alarm address for the given element (dpe)
Set up periphery address of bool dpe which is linked to StsReg for S7 or UNICOS (Schneider)
dsConfigs | importation line, processed in the unCore | |
deviceType | device type | |
alertName | dpe name | |
alertProps | dpe properties | |
plcType | current plc type | |
regName | name of StsReg dpe which contains the bit to link to | |
exceptionInfo | exception info |
References CPC_CMW_DPTYPE, cpcConfigGenericFunctions_getConstantDPEAdress(), and cpcConfigGenericFunctions_setCMWAddress().
Referenced by cpcConfigGenericFunctions_setDeviceConfig().
void cpcConfigGenericFunctions_setAlertDetails | ( | dyn_string | dsConfigs, | |
string | deviceType, | |||
string | alertName, | |||
mapping | alertProps, | |||
string | plcType, | |||
string | regName, | |||
dyn_string & | exceptionInfo | |||
) |
Set alarm config for the given element (dpe)
dsConfigs | importation line, processed in the unCore | |
deviceType | device type | |
alertName | dpe name | |
alertProps | dpe properties | |
plcType | current plc type | |
regName | name of StsReg dpe which contains the bit to link to | |
exceptionInfo | exception info |
References CPC_CONFIG_ALARM_CUSTOM_OK_POSTFIX, CPC_UNDEFINED_CONSTANT_VALUE, cpcConfigGenericFunctions_checkBool(), cpcConfigGenericFunctions_getAlertClass(), cpcConfigGenericFunctions_getConstant(), cpcConfigGenericFunctions_getStringConstantByName(), and cpcConfigGenericFunctions_setDigitalAlert().
Referenced by cpcConfigGenericFunctions_setDeviceConfig().
void cpcConfigGenericFunctions_setDigitalAlert | ( | string | sDpName, | |
dyn_string | dsdescription, | |||
dyn_string | dsAlertTexts, | |||
dyn_string | dsAlertClasses, | |||
bool | bOkRange, | |||
bool | active, | |||
bool | bSMS, | |||
dyn_string & | exceptionInfo | |||
) |
Save alerm info
Port of unConfigGenericFunctions_setDigitalAlert
sDpName | datapoint name | |
dsdescription | datapoint description | |
dsAlertTexts | alerm messages (On and Off) | |
dsAlertClasses | alert class, should exist in db | |
bOkRange | deprecated | |
active | is alarm active | |
bSMS | deprecated | |
exceptionInfo | exception info |
Referenced by cpcConfigGenericFunctions_setAlertDetails().
void cpcConfigGenericFunctions_set5RangesAlert | ( | dyn_string | dsConfigs, | |
string | sDp, | |||
string | description, | |||
bool | acknowledgeAlarm, | |||
bool | alarmActive, | |||
bool | bSMS, | |||
dyn_int | diLimits, | |||
dyn_string & | exceptionInfo | |||
) |
Set 5 ranges _alert_hdl on given dpe
Port of unConfigGenericFunctions_set5RangesAlert
dsConfigs | importation line, processed in the unCore | |
sDp | dpe name | |
description | description | |
acknowledgeAlarm | is alarm acknowledgeable | |
alarmActive | is alarm active | |
bSMS | does alarm trigger mail/sms notifier | |
diLimits | ubdex of 4 limits - LL,L,H,HH - in the importation line; device's importation constant should be used | |
exceptionInfo | exception info |
References cpcConfigGenericFunctions_get5AlertConfig().
Referenced by cpcConfigGenericFunctions_setDeviceConfig().
void cpcConfigGenericFunctions_get5AlertConfig | ( | string | LLparam, | |
string | Lparam, | |||
string | Hparam, | |||
string | HHparam, | |||
bool | bSMS, | |||
bool | acknowledgeAlarm, | |||
dyn_float & | dfLevelLimits, | |||
dyn_string & | dsLevelsAlarm, | |||
dyn_string & | dsLevelsAlertsClass | |||
) |
Build config of 5-range alert
Port of unConfigGenericFunctions_set4LevelsAlert
LLparam | LL threshold value | |
Lparam | L threshold value | |
Hparam | H threshold value | |
HHparam | HH threshold value | |
bSMS | does alarm trigger mail/sms notifier | |
acknowledgeAlarm | is alarm acknowledgeable | |
dfLevelLimits | threshold values array | |
dsLevelsAlarm | threshold levels array | |
dsLevelsAlertsClass | threshold classes array |
Referenced by cpcConfigGenericFunctions_set5RangesAlert().
string cpcConfigGenericFunctions_getAlertClass | ( | bool | acknowledgeAlarm, | |
bool | bSMS, | |||
string | postfix = "" | |||
) |
Returns alert class according to passed params
acknowledgeAlarm | is alarm acknowledgeable | |
bSMS | does alarm trigger mail/sms notifier | |
postfix | class postfix |
References CPC_CONFIG_ALARM_ACK_POSTFIX, CPC_CONFIG_ALARM_BASE_CLASS, and CPC_CONFIG_ALARM_MAIL_POSTFIX.
Referenced by cpcConfigGenericFunctions_setAlertDetails().
dyn_string cpcConfigGenericFunctions_getDeviceParamNames | ( | string | deviceType | ) |
Return the list of parameter names of device
This list is defined in DT_Config.ctl script by function called DT_getParamNames()
deviceType | device type |
References cpcConfigGenericFunctions_getShortTypeName().
Referenced by cpcConfigGenericFunctions_checkParameters().
mapping cpcConfigGenericFunctions_getDPEConfig | ( | string | deviceType | ) |
Returns dpes config
This mapping is defined in DT_Config.ctl script by function called DT_getConfig()
deviceType | device type |
References CPC_BOOL, cpcConfigGenericFunctions_getFrontEndType(), and cpcConfigGenericFunctions_getShortTypeName().
Referenced by cpcConfigGenericFunctions_checkDeviceConfig(), cpcConfigGenericFunctions_setDeviceConfig(), and cpcConfigGenericFunctions_setMaskEvent().
int cpcConfigGenericFunctions_getConstant | ( | string | deviceType, | |
string | constantName | |||
) |
Return the value of a device's property constant
Property's constant should be defined in DP_Config.ctl script and have following notation FRONT_END_PREFIX_SHORT_DEVICE_NAME_PROPERTY_NAME%
deviceType | device type | |
constantName | constant name |
References cpcConfigGenericFunctions_getConstantPrefix(), and cpcConfigGenericFunctions_getFrontEndType().
Referenced by cpcConfigGenericFunctions_checkDeviceConfig(), cpcConfigGenericFunctions_getConstantDPAdditionalLength(), cpcConfigGenericFunctions_getConstantDPLength(), cpcConfigGenericFunctions_setAlertDetails(), and cpcConfigGenericFunctions_setDeviceConfig().
int cpcConfigGenericFunctions_getConstantDPEAdress | ( | string | deviceType, | |
string | address | |||
) |
Returns address position in the importation line for passed DPE name
deviceType | device type | |
address | DPE name |
References cpcConfigGenericFunctions_getConstantByName(), cpcConfigGenericFunctions_getConstantPrefix(), and cpcConfigGenericFunctions_getFrontEndType().
Referenced by cpcConfigGenericFunctions_checkDeviceAddress(), cpcConfigGenericFunctions_checkDeviceConfig(), cpcConfigGenericFunctions_setAlert(), and cpcConfigGenericFunctions_setDeviceConfig().
int cpcConfigGenericFunctions_getConstantDPEProperty | ( | string | deviceType, | |
string | addrName, | |||
bool | hasArchive, | |||
string | propName | |||
) |
Returns config position for given device type, periphery address name and property name.
Function make a lookup for constant UN_CONFIG_[DEVICE]_[ADDRESS_NAME]_[PROP]. if not found then try constant UN_CONFIG_[DEVICE]_[PROP]
deviceType | device type | |
addrName | DPE name | |
hasArchive | does importation line contain bool/analog/event archives | |
propName | DPE's property name |
References cpcConfigGenericFunctions_getConstantByName(), cpcConfigGenericFunctions_getConstantDPLength(), cpcConfigGenericFunctions_getConstantPrefix(), and cpcConfigGenericFunctions_getFrontEndType().
Referenced by cpcConfigGenericFunctions_checkDeviceConfig(), cpcConfigGenericFunctions_getRange(), cpcConfigGenericFunctions_setArchive(), cpcConfigGenericFunctions_setDescription(), cpcConfigGenericFunctions_setDeviceConfig(), cpcConfigGenericFunctions_setFormat(), cpcConfigGenericFunctions_setMetainfo(), cpcConfigGenericFunctions_setSmoothing(), and cpcConfigGenericFunctions_setUnit().
int cpcConfigGenericFunctions_getConstantDPLength | ( | string | deviceType | ) |
Returns a length of importation line
deviceType | device type |
References cpcConfigGenericFunctions_getConstant().
Referenced by cpcConfigGenericFunctions_checkArchiveConfig(), cpcConfigGenericFunctions_checkConfigLength(), cpcConfigGenericFunctions_checkDeviceConfig(), cpcConfigGenericFunctions_getConstantDPEProperty(), and cpcConfigGenericFunctions_setDeviceConfig().
int cpcConfigGenericFunctions_getConstantDPAdditionalLength | ( | string | deviceType | ) |
Returns an additional length of importation line
deviceType | device type |
References cpcConfigGenericFunctions_getConstant().
Referenced by cpcConfigGenericFunctions_checkArchiveConfig(), cpcConfigGenericFunctions_checkConfigLength(), cpcConfigGenericFunctions_checkDeviceConfig(), and cpcConfigGenericFunctions_setDeviceConfig().
anytype cpcConfigGenericFunctions_getConstantByName | ( | string | name | ) |
Returns a value of constant by name
Returns -1 if value is not defined.
name | constant name |
Referenced by cpcConfigGenericFunctions_getConstantDPEAdress(), cpcConfigGenericFunctions_getConstantDPEProperty(), cpcFaceplate_fetchStsRegBitAndValidness(), cpcGenericObject_StsRegConstantNameToValue(), and cpcGenericObject_WidgetControlStateAnimation().
string cpcConfigGenericFunctions_getStringConstantByName | ( | string | name | ) |
Returns a string value of constant by name
Returns CPC_UNDEFINED_CONSTANT_VALUE if value is not defined.
name | constant name |
Referenced by cpcConfigGenericFunctions_setAlertDetails(), and cpcGenericObject_WidgetControlStateAnimation().
string cpcConfigGenericFunctions_getShortTypeName | ( | string | deviceType | ) |
Returns a device type name without CPC_ prefix
deviceType | device type |
Referenced by cpcConfigGenericFunctions_checkDeviceConfig(), cpcConfigGenericFunctions_getDeviceParamNames(), cpcConfigGenericFunctions_getDPEConfig(), and cpcConfigGenericFunctions_setDeviceConfig().
string cpcConfigGenericFunctions_getConstantPrefix | ( | string | plcType | ) |
Returns a position constants prefix
Can be SOFT_FE for SOFT Front-End or UN_CONFIG for others.
plcType | plc type |
References CPC_CMW_DPTYPE, and cpcConfigGenericFunctions_getFrontEndType().
Referenced by cpcConfigGenericFunctions_getConstant(), cpcConfigGenericFunctions_getConstantDPEAdress(), and cpcConfigGenericFunctions_getConstantDPEProperty().
string cpcConfigGenericFunctions_getFrontEndType | ( | ) |
Returns selected front-end type
Referenced by CPC_AnalogInputConfig_getConfig(), CPC_DigitalInputConfig_getConfig(), cpcConfigGenericFunctions_checkDeviceConfig(), cpcConfigGenericFunctions_getConstant(), cpcConfigGenericFunctions_getConstantDPEAdress(), cpcConfigGenericFunctions_getConstantDPEProperty(), cpcConfigGenericFunctions_getConstantPrefix(), cpcConfigGenericFunctions_getDPEConfig(), and cpcConfigGenericFunctions_setDeviceConfig().
int cpcConfigGenericFunctions_translateDataType | ( | string | plcType, | |
int | commonDataType | |||
) |
Convert CPC data-type representation to the front-end specific
plcType | plc to translate to | |
commonDataType | CPC data type |
References CPC_BOOL, CPC_FLOAT, CPC_INT16, CPC_INT32, and CPC_UINT16.
Referenced by cpcConfigGenericFunctions_setAddress().
int cpcConfigGenericFunctions_translateDataTypeForS7Check | ( | int | commonDataType | ) |
Convert CPC data-type representation to the S7 check data type
commonDataType | CPC data type |
References CPC_BOOL, CPC_FLOAT, CPC_INT16, CPC_INT32, and CPC_UINT16.
Referenced by cpcConfigGenericFunctions_checkDeviceAddress().
dyn_string splitCommaSeparatedString | ( | string | data | ) |
Split comma-separated string and trim each element
data | comma-separated string |
Referenced by cpcConfigGenericFunctions_setMetainfo().
void cpcConfigGenericFunctions_processArchives | ( | int | iToSkip, | |
bool | hasArchive, | |||
dyn_string & | dsConfigs | |||
) |
Gets archiving configs from object and puts them to the common archiving configs.
iToSkip | Num elements in dsConfigs to skip before common part | |
hasArchive | is archived defined in the importation line | |
dsConfigs | importation line, processed in the unCore |
Referenced by cpcConfigGenericFunctions_setDeviceConfig().