unCPC6  6.6.2
WinCC-OA implementation of UNICOS CPC
 All Files Functions Variables Pages
cpcConfigGenericFunctions.ctl File Reference

This library contains functions called from other unCPC scripts. More...

Functions

void cpcConfigGenericFunctions_genericCheckDeviceConfig (dyn_string dsConfigs, dyn_string &exceptionInfo)
 
void cpcConfigGenericFunctions_genericSetDeviceConfig (dyn_string dsConfigs, dyn_string &exceptionInfo)
 
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_checkMapping (dyn_string dsConfigs, string sLabels, 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 sFrontEndType, string sDeviceType, string sAddressValue, mapping mAddressProperties, 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_setMapping (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 sRegName, mapping mRegProperties, string sAddressValue, string sFrontEndType, dyn_string &exceptionInfo)
 
void cpcConfigGenericFunctions_setCMWAddress (string dpeName, string addressReference, string driverReference, dyn_string &exceptionInfo)
 
void cpcConfigGenericFunctions_checkAddressIEC (string sAddressValue, dyn_string &exceptionInfo)
 
 cpcConfigGenericFunctions_checkAddressOPCUA (string address, dyn_string &exceptionInfo)
 
 cpcConfigGenericFunctions_checkAddressSNMP (string addressReference, dyn_string &exceptionInfo)
 
void cpcConfigGenericFunctions_setAddressOPCUA (string dpeName, string addressReference, int dataType, string driverReference, dyn_string &exceptionInfo)
 
void cpcConfigGenericFunctions_setBACnetAddress (string dpeName, string frontEndName, string addressReference, int dataType, string driverReference, dyn_string &exceptionInfo)
 
void cpcConfigGenericFunctions_setDIPAddress (string dpeName, string frontEndName, string addressReference, dyn_string &exceptionInfo)
 
void cpcConfigGenericFunctions_setSNMPAddress (string sDpeName, string sFrontEndName, string sAddressReference, string sDriverReference, dyn_string &exceptionInfo)
 
void cpcConfigGenericFunctions_setIEC104Address (string sDpeName, string sFrontEndName, string sAddressReference, string sDriver, dyn_string &exceptionInfo)
 
void cpcConfigGenericFunctions_setAlert (dyn_string dsConfigs, string sDeviceType, string sAlertName, mapping mAlertProperties, string sFrontEndType, string sRegisterName, dyn_string &exceptionInfo)
 
void cpcConfigGenericFunctions_setAlertDetails (dyn_string dsConfigs, string deviceType, string alertName, mapping alertProps, string plcType, string regName, dyn_string &exceptionInfo)
 
bool cpcConfigGenericFunctions_alertWithMail (string deviceName, string alertName, string category="")
 
void cpcConfigGenericFunctions_setDigitalAlert (string sDpName, dyn_string dsdescription, dyn_string dsAlertTexts, dyn_string dsAlertClasses, bool bOkRange, bool active, bool bSMS, dyn_string &exceptionInfo)
 
 cpcConfigGenericFunctions_createAlarmDescription (string sDomainConfig, string sNatureConfig, string sAlias, string sDescription, string sAlarmName, string sDefaultPanel, dyn_string &dsDescription)
 
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="", string baseClass=CPC_CONFIG_ALARM_BASE_CLASS)
 
dyn_string cpcConfigGenericFunctions_getDeviceParamNames (string deviceType)
 
mapping cpcConfigGenericFunctions_getDPEConfig (string deviceType)
 
int cpcConfigGenericFunctions_getConstant (string deviceType, string constantName, bool verbose=false)
 
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 ()
 
string cpcConfigGenericFunctions_getFrontEndType (dyn_string dsConfig)
 
int cpcConfigGenericFunctions_translateDataType (string sFrontEndType, int iCommonDataType)
 
int cpcConfigGenericFunctions_translateDataTypeForS7Check (int commonDataType)
 
dyn_string splitCommaSeparatedString (string data)
 
void cpcConfigGenericFunctions_processArchives (int iToSkip, bool hasArchive, dyn_string &dsConfigs)
 
mapping cpcConfigGenericFunctions_getParametersMapping (dyn_string dsConfigs, string sDeviceType, bool bHasArchive)
 
void cpcConfigGenericFunctions_checkMsgConv (string sConversion, dyn_string &exceptionInfo)
 
void cpcConfigGenericFunctions_setMsgConv (string sConversion, dyn_string dpes, dyn_string &exceptionInfo)
 
void cpcConfigGenericFunctions_eventCommand (string textBox)
 

Variables

const string PARAM_DPE_VALUE = "value:"
 

Detailed Description

This library contains functions called from other unCPC scripts.

Author
Jonas Arroyo (BE-ICS-FD)
Ivan Koblik (IT-CO-FE)
Nikolay Kulman (IT-CO-FE)
Geraldine Thomas (IT-CO-FE)
Francisco Mico (IT-CO-FE)
Alexey Merezhin (EN-ICE-PLC)
Creation Date
14.11.2003
Constraints
None
Usage
Public
PVSS managers
UI, CTRL

Function Documentation

void cpcConfigGenericFunctions_genericCheckDeviceConfig ( dyn_string  dsConfigs,
dyn_string &  exceptionInfo 
)
Check data of the $sDeviceType object before configuration. It calls or reproduces following calls:
    unConfigGenericFunctions_checkParameters(dsConfigs, deviceType, exceptionInfo);
    unConfigGenericFunctions_checkDeviceConfig(dsConfigs, deviceType, exceptionInfo);

Device can specify its own checkConfig function by specifying it in device type configuration. Also it can overwrite the check for specific front-end as in following example for CMW front end of CPC_WordStatus object: {code} CMW_CPC_WordStatus_checkConfig(dyn_string configLine, dyn_string &exceptionInfo) { cpcConfigGenericFunctions_checkDeviceConfig(UN_CONFIG_CPC_WORDSTATUS_DPT_NAME, configLine, exceptionInfo); } {code}

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
dsConfigsimportation line, processed in the unCore
exceptionInfoexception info

References cpcConfigGenericFunctions_checkDeviceConfig().

void cpcConfigGenericFunctions_genericSetDeviceConfig ( dyn_string  dsConfigs,
dyn_string &  exceptionInfo 
)
Creates dp (or checks if it is already presented) and sets configuration for the $sDeviceType object. That calls or reproduces following calls:
    unConfigGenericFunctions_createDp
    unConfigGenericFunctions_setCommon
    unConfigGenericFunctions_setDeviceConfig

Device can specify its own setConfig function by specifying it in device type configuration. Also it can overwrite the set for specific front-end as in following example for Schneider (_UnPlc) front end of CPC_WordStatus object: {code} _UnPlc_CPC_WordStatus_setConfig(dyn_string dsConfigs, dyn_string &exceptionInfo) { cpcConfigGenericFunctions_setDeviceConfig(dsConfigs, exceptionInfo); } {code}

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
dsConfigsimportation line, processed in the unCore
exceptionInfoexception info

References cpcConfigGenericFunctions_setDeviceConfig().

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_checkMapping ( 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"

Parameters
dsConfigsimportation line, processed in the unCore
sLabelsstring to test that contains comma separated values
exceptionInfoexception 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.

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
deviceTypeDPT name
dsConfigsimportation line, processed in the unCore
bHasArchiveset to true if passed config importation line contains bool/analog/event archives, otherwise set to false
Returns
result of checking, true if config has a proper length, otherwise it's 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.

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
deviceTypeDPT name
dsConfigsimportation line, processed in the unCore
exceptionInfoexception info

References cpcConfigGenericFunctions_getConstantDPAdditionalLength(), and cpcConfigGenericFunctions_getConstantDPLength().

Referenced by cpcConfigGenericFunctions_checkDeviceConfig().

void cpcConfigGenericFunctions_checkDeviceAddress ( dyn_string  dsConfigs,
string  sFrontEndType,
string  sDeviceType,
string  sAddressValue,
mapping  mAddressProperties,
bool  bHasArchive,
dyn_string &  exceptionInfo 
)

Check device address

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
dsConfigsimportation line, processed in the unCore
plcTypecurrent plc type
deviceTypedevice type
addressValueaddress reference
addrPropschecked address properties
bHasArchivedoes importation line contain bool/analog/event archives
exceptionInfoexception info
Returns
nothing

References CPC_BACNET_DPTYPE, CPC_CMW_DPTYPE, CPC_DIP_DPTYPE, CPC_OPCUA_DPTYPE, CPC_SNMP_DPTYPE, cpcConfigGenericFunctions_checkAddressCMW(), cpcConfigGenericFunctions_checkAddressIEC(), cpcConfigGenericFunctions_checkAddressSNMP(), 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.

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
addressaddress string
exceptionInfoexception info

References CPC_CMW_ADDRESS_CONFIG_SEPARATOR.

Referenced by cpcConfigGenericFunctions_checkDeviceAddress().

void cpcConfigGenericFunctions_check5RangesAlert ( dyn_string  dsConfigs,
int  alarmActivePos,
dyn_int  diLimits,
dyn_string &  exceptionInfo 
)

Check 5 ranges _alert_hdl data.

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
dsConfigsimportation line, processed in the unCore
alarmActivePosposition of alarm active field in the importation line; device's importation constant should be used.
diLimitspositions of 4 limits - LL,L,H,HH - in the importation line; device's importation constant should be used.
exceptionInfoexception info

References cpcConfigGenericFunctions_checkBool().

Referenced by CPC_AnalogStatusConfig_checkCustomConfig(), and 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.

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
deviceTypeimportation line, processed in the unCore
parametersparameters value
exceptionInfoexception 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.

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
dsConfigsimportation line, processed in the unCore
exceptionInfoexception info

References CPC_BOOL, CPC_CONFIG_SMS_MESSAGE, cpcConfigGenericFunctions_alertWithMail(), cpcConfigGenericFunctions_checkBool(), cpcConfigGenericFunctions_getConstant(), cpcConfigGenericFunctions_getConstantDPAdditionalLength(), cpcConfigGenericFunctions_getConstantDPEAdress(), cpcConfigGenericFunctions_getConstantDPEProperty(), cpcConfigGenericFunctions_getConstantDPLength(), cpcConfigGenericFunctions_getDPEConfig(), cpcConfigGenericFunctions_getShortTypeName(), cpcConfigGenericFunctions_processArchives(), cpcConfigGenericFunctions_set5RangesAlert(), cpcConfigGenericFunctions_setAddress(), cpcConfigGenericFunctions_setAlert(), cpcConfigGenericFunctions_setAlertDetails(), cpcConfigGenericFunctions_setArchive(), cpcConfigGenericFunctions_setDPEAlias(), cpcConfigGenericFunctions_setEvArchive(), cpcConfigGenericFunctions_setFormat(), cpcConfigGenericFunctions_setMapping(), cpcConfigGenericFunctions_setMaskEvent(), cpcConfigGenericFunctions_setMetainfo(), cpcConfigGenericFunctions_setParameters(), cpcConfigGenericFunctions_setRange(), cpcConfigGenericFunctions_setSmoothing(), cpcConfigGenericFunctions_setUnit(), and cpcGenericDpFunctions_getDeviceProperty().

Referenced by cpcConfigGenericFunctions_genericSetDeviceConfig().

void cpcConfigGenericFunctions_setDPEAlias ( string  deviceName,
string  dpe,
dyn_string &  exceptionInfo 
)

Set DPE alias to alias%.dpe_name% (e.g. "object1.PosSt")

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
deviceNamedevice name (alias)
dpefull dpe name (e.g. dist_1:un-PLCATLTRT-ATLTRT-CPC_AnalogParameter-00001.ProcessInput.PosSt)
exceptionInfoexception info

Referenced by cpcConfigGenericFunctions_setDeviceConfig().

void cpcConfigGenericFunctions_setMapping ( dyn_string  dsConfigs,
string  deviceType,
string  regName,
mapping  regProperties,
string  plcType,
bool  bHasArchive,
dyn_string &  exceptionInfo 
)

Set description for the given element (dpe)

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
dsConfigsimportation line, processed in the unCore
deviceTypedevice type
regNamedpe name
regPropertiesdpe properties
plcTypecurrent plc type
bHasArchivedoes importation line contain bool/analog/event archives
exceptionInfoexception info

References CPC_CONFIG_MAPPING, 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)

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
dsConfigsimportation line, processed in the unCore
deviceTypedevice type
regNamedpe name
regPropertiesdpe properties
plcTypecurrent plc type
bHasArchivedoes importation line contain bool/analog/event archives
exceptionInfoexception 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)

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
dsConfigsimportation line, processed in the unCore
deviceTypedevice type
regNamedpe name
regPropertiesdpe properties
plcTypecurrent plc type
bHasArchivedoes importation line contain bool/analog/event archives
exceptionInfoexception 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

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
dsConfigsimportation line, processed in the unCore
deviceTypedevice type
regNamedpe name
rangeMaxmax range to set
rangeMinmin range to set
bHasArchivedoes 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)

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
dsConfigsimportation line, processed in the unCore
deviceTypedevice type
regNamedpe name
regPropertiesdpe properties
plcTypecurrent plc type
bHasArchivedoes importation line contain bool/analog/event archives
exceptionInfoexception 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)

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
deviceTypedevice type
dsConfigsimportation line, processed in the unCore
parametersparameters value
exceptionInfoexception 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

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
deviceTypedevice type
dsConfigsimportation line, processed in the unCore
hasArchivedoes importation line contain bool/analog/event archives
exceptionInfoexception 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.

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
dsConfigsimportation line, processed in the unCore
deviceTypedevice type
regNamedpe name
regPropertiesdpe properties
plcTypecurrent plc type
bHasArchivedoes importation line contain bool/analog/event archives
exceptionInfoexception 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".

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
dsConfigsimportation line, processed in the unCore
deviceTypedevice type
regNamedpe name
regPropertiesdpe properties
plcTypecurrent plc type
bHasArchivedoes importation line contain bool/analog/event archives
exceptionInfoexception 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.

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
dsConfigsimportation line, processed in the unCore
addressdpe name
exceptionInfoexception info

Referenced by cpcConfigGenericFunctions_setDeviceConfig().

void cpcConfigGenericFunctions_setMaskEvent ( string  deviceType,
string  deviceName,
bool  isMasked,
dyn_string &  exceptionInfo 
)

Set mask state for the given device

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
deviceTypedevice type
deviceNamedevice name
isMaskedmask state to set
exceptionInfoexception info

References CPC_BOOL, and cpcConfigGenericFunctions_getDPEConfig().

Referenced by cpcConfigGenericFunctions_setDeviceConfig(), and cpcGenericObject_HandleUnicosMenu().

void cpcConfigGenericFunctions_setAddress ( dyn_string  dsConfigs,
string  sRegName,
mapping  mRegProperties,
string  sAddressValue,
string  sFrontEndType,
dyn_string &  exceptionInfo 
)

Set address for the given element (dpe)

Set up periphery address for S7 or UNICOS (Schneider)

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
dsConfigsimportation line, processed in the unCore
regNamedpe name
regPropertiesdpe properties
regPositionadress position in the importation line
plcTypecurrent plc type
exceptionInfoexception info
Returns
nothing

References CPC_BACNET_DPTYPE, CPC_CMW_DPTYPE, CPC_DIP_DPTYPE, CPC_OPCUA_DPTYPE, CPC_SNMP_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

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
dpeNamedpe name
addressReferenceaddress configuration in the importation line
driverReferencedriver reference
exceptionInfoexception info

References CPC_CMW_ADDRESS_CONFIG_SEPARATOR.

Referenced by cpcConfigGenericFunctions_setAddress(), and cpcConfigGenericFunctions_setAlert().

void cpcConfigGenericFunctions_checkAddressIEC ( string  sAddressValue,
dyn_string &  exceptionInfo 
)

Check IEC104 address config

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
sAddress,string,IEC104address reference
exceptionInfoexception info
Returns
Nothing

Referenced by cpcConfigGenericFunctions_checkDeviceAddress().

cpcConfigGenericFunctions_checkAddressSNMP ( string  addressReference,
dyn_string &  exceptionInfo 
)

Check if SNMP address is correctly formered. It's allows to have an emtpy string for address.

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
addressReferenceaddress string
exceptionInfoexception info

Referenced by cpcConfigGenericFunctions_checkDeviceAddress().

void cpcConfigGenericFunctions_setAlert ( dyn_string  dsConfigs,
string  sDeviceType,
string  sAlertName,
mapping  mAlertProperties,
string  sFrontEndType,
string  sRegisterName,
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)

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
dsConfigsimportation line, processed in the unCore
deviceTypedevice type
alertNamedpe name
alertPropsdpe properties
plcTypecurrent plc type
regNamename of StsReg dpe which contains the bit to link to
exceptionInfoexception info

References CPC_BACNET_DPTYPE, CPC_CMW_DPTYPE, CPC_DIP_DPTYPE, CPC_OPCUA_DPTYPE, CPC_SNMP_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)

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
dsConfigsimportation line, processed in the unCore
deviceTypedevice type
alertNamedpe name
alertPropsdpe properties
plcTypecurrent plc type
regNamename of StsReg dpe which contains the bit to link to
exceptionInfoexception info

References CPC_CONFIG_ALARM_CUSTOM_OK_POSTFIX, CPC_UNDEFINED_CONSTANT_VALUE, cpcConfigGenericFunctions_checkBool(), cpcConfigGenericFunctions_createAlarmDescription(), cpcConfigGenericFunctions_getAlertClass(), cpcConfigGenericFunctions_getConstant(), cpcConfigGenericFunctions_getStringConstantByName(), and cpcConfigGenericFunctions_setDigitalAlert().

Referenced by cpcConfigGenericFunctions_setDeviceConfig().

bool cpcConfigGenericFunctions_alertWithMail ( string  deviceName,
string  alertName,
string  category = "" 
)

return true if alertName should be configured with mail handler returns true except there's device property DPE_NO_MAIL = true and CATEGORY_DPE_NO_MAIL = true alertName name of dpe with alert handler, for example "PosSt"

References cpcConfigGenericFunctions_checkBool(), and cpcGenericDpFunctions_getDeviceProperty().

Referenced by CPC_WordStatusConfig_setCustomConfig(), and 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

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
sDpNamedatapoint name
dsdescriptiondatapoint description
dsAlertTextsalerm messages (On and Off)
dsAlertClassesalert class, should exist in db
bOkRangedeprecated
activeis alarm active
bSMSdeprecated
exceptionInfoexception info

Referenced by cpcConfigGenericFunctions_setAlertDetails().

cpcConfigGenericFunctions_createAlarmDescription ( string  sDomainConfig,
string  sNatureConfig,
string  sAlias,
string  sDescription,
string  sAlarmName,
string  sDefaultPanel,
dyn_string &  dsDescription 
)

Create

get alarm description

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
dsConfigsimportation line, processed in the unCore
descriptiondescription
dsDescriptiondescription in the format needed by unConfigGenericFunctions_setAlarmDescription

Referenced by CPC_WordStatusConfig_setCustomConfig(), cpcConfigGenericFunctions_set5RangesAlert(), and 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

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
dsConfigsimportation line, processed in the unCore
sDpdpe name
descriptiondescription
acknowledgeAlarmis alarm acknowledgeable
alarmActiveis alarm active
bSMSdoes alarm trigger mail/sms notifier
diLimitsubdex of 4 limits - LL,L,H,HH - in the importation line; device's importation constant should be used
exceptionInfoexception info

References cpcConfigGenericFunctions_createAlarmDescription(), and 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

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
LLparamLL threshold value
LparamL threshold value
HparamH threshold value
HHparamHH threshold value
bSMSdoes alarm trigger mail/sms notifier
acknowledgeAlarmis alarm acknowledgeable
dfLevelLimitsthreshold values array
dsLevelsAlarmthreshold levels array
dsLevelsAlertsClassthreshold classes array

Referenced by cpcConfigGenericFunctions_set5RangesAlert().

string cpcConfigGenericFunctions_getAlertClass ( bool  acknowledgeAlarm,
bool  bSMS,
string  postfix = "",
string  baseClass = CPC_CONFIG_ALARM_BASE_CLASS 
)
Returns alert class according to passed params
Constraints
None
Usage
Public
PVSS managers
UI
Parameters
acknowledgeAlarmis alarm acknowledgeable
bSMSdoes alarm trigger mail/sms notifier
postfixclass postfix

References CPC_CONFIG_ALARM_ACK_POSTFIX, and CPC_CONFIG_ALARM_MAIL_POSTFIX.

Referenced by CPC_WordStatusConfig_setCustomConfig(), and 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()

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
deviceTypedevice type
Returns
device's parameter names list

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()

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
deviceTypedevice type
Returns
dpes configs

References _cpcConfigGenericFunctions_getFrontEndType(), CPC_BOOL, and cpcConfigGenericFunctions_getShortTypeName().

Referenced by cpcConfigGenericFunctions_checkDeviceConfig(), cpcConfigGenericFunctions_setDeviceConfig(), and cpcConfigGenericFunctions_setMaskEvent().

int cpcConfigGenericFunctions_getConstant ( string  deviceType,
string  constantName,
bool  verbose = false 
)

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%

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
deviceTypedevice type
constantNameconstant name
Returns
device's property value

References _cpcConfigGenericFunctions_getFrontEndType(), and cpcConfigGenericFunctions_getConstantPrefix().

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

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
deviceTypedevice type
addressDPE name

References _cpcConfigGenericFunctions_getFrontEndType(), cpcConfigGenericFunctions_getConstantByName(), and cpcConfigGenericFunctions_getConstantPrefix().

Referenced by 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]

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
deviceTypedevice type
addrNameDPE name
hasArchivedoes importation line contain bool/analog/event archives
propNameDPE's property name

References _cpcConfigGenericFunctions_getFrontEndType(), cpcConfigGenericFunctions_getConstantByName(), cpcConfigGenericFunctions_getConstantDPLength(), and cpcConfigGenericFunctions_getConstantPrefix().

Referenced by CPC_ProcessControlObjectConfig_checkCustomConfig(), cpcConfigGenericFunctions_checkDeviceConfig(), cpcConfigGenericFunctions_getParametersMapping(), cpcConfigGenericFunctions_getRange(), cpcConfigGenericFunctions_setArchive(), cpcConfigGenericFunctions_setDeviceConfig(), cpcConfigGenericFunctions_setFormat(), cpcConfigGenericFunctions_setMapping(), cpcConfigGenericFunctions_setMetainfo(), cpcConfigGenericFunctions_setSmoothing(), and cpcConfigGenericFunctions_setUnit().

int cpcConfigGenericFunctions_getConstantDPLength ( string  deviceType)
int cpcConfigGenericFunctions_getConstantDPAdditionalLength ( string  deviceType)

Returns an additional length of importation line

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
deviceTypedevice 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.

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
nameconstant name
Returns
constant's value

Referenced by cpcConfigGenericFunctions_getConstantDPEAdress(), cpcConfigGenericFunctions_getConstantDPEProperty(), 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.

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
nameconstant name
Returns
constant's value

Referenced by cpcConfigGenericFunctions_setAlertDetails(), and cpcGenericObject_WidgetControlStateAnimation().

string cpcConfigGenericFunctions_getShortTypeName ( string  deviceType)

Returns a device type name without CPC_ prefix

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
deviceTypedevice type
Returns
DT name without CPC_ prefix

Referenced by cpcConfigGenericFunctions_checkDeviceConfig(), cpcConfigGenericFunctions_getDeviceParamNames(), cpcConfigGenericFunctions_getDPEConfig(), cpcConfigGenericFunctions_setDeviceConfig(), and cpcExportGenericFunctions_getArchivedDpes().

string cpcConfigGenericFunctions_getConstantPrefix ( string  plcType)

Returns a position constants prefix

Can be SOFT_FE for SOFT Front-End or UN_CONFIG for others.

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
plcTypeplc type
Returns
front-end related prefix

References _cpcConfigGenericFunctions_getFrontEndType().

Referenced by cpcConfigGenericFunctions_getConstant(), cpcConfigGenericFunctions_getConstantDPEAdress(), and cpcConfigGenericFunctions_getConstantDPEProperty().

string _cpcConfigGenericFunctions_getFrontEndType ( )
int cpcConfigGenericFunctions_translateDataType ( string  sFrontEndType,
int  iCommonDataType 
)

Convert CPC data-type representation to the front-end specific

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
plcTypeplc to translate to
commonDataTypeCPC data type
Returns
int, fromt end data type

References CPC_BACNET_DPTYPE, CPC_BOOL, CPC_FLOAT, CPC_INT16, CPC_INT32, CPC_OPCUA_DPTYPE, CPC_SNMP_DPTYPE, and CPC_UINT16.

Referenced by cpcConfigGenericFunctions_setAddress().

int cpcConfigGenericFunctions_translateDataTypeForS7Check ( int  commonDataType)

Convert CPC data-type representation to the S7 check data type

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
commonDataTypeCPC data type
Returns
S7 data type check

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

Constraints
None
Usage
Public
PVSS managers
UI
Todo:
move to generic place. reuse in other places. merge with cpcGenericObject_StringToMapping
Parameters
datacomma-separated string
Returns
array of trimmed elements

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.

Todo:
move to the unicos core
Constraints
None
Usage
Public
PVSS managers
UI
Parameters
iToSkipNum elements in dsConfigs to skip before common part
hasArchiveis archived defined in the importation line
dsConfigsimportation line, processed in the unCore

Referenced by cpcConfigGenericFunctions_setDeviceConfig().

mapping cpcConfigGenericFunctions_getParametersMapping ( dyn_string  dsConfigs,
string  sDeviceType,
bool  bHasArchive 
)

Gets additional parameters configs from object and puts them to a mapping.

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
dsConfigsimportation line, processed in the unCore
sDeviceTypeDevice type name
bHasArchiveis archived defined in the importation line

References cpcConfigGenericFunctions_getConstantDPEProperty().

Referenced by CPC_AnalogInputConfig_checkCustomConfig(), CPC_AnalogStatusConfig_checkCustomConfig(), and CPC_WordStatusConfig_checkCustomConfig().

void cpcConfigGenericFunctions_checkMsgConv ( string  sConversion,
dyn_string &  exceptionInfo 
)

Checks message convertion parameter

Constraints
None
Usage
Public
PVSS managers
UI
Parameters
sConversionstring with message convertion configuration
exceptionInfofor errors

Referenced by CPC_AnalogInputConfig_checkCustomConfig(), and CPC_AnalogStatusConfig_checkCustomConfig().

void cpcConfigGenericFunctions_setMsgConv ( string  sConversion,
dyn_string  dpes,
dyn_string &  exceptionInfo 
)
Sets _msg_conv dpe config based on given parameter string
Constraints
None
Usage
Public
PVSS managers
UI
Parameters
sConversionstring with message convertion configuration
dpeslist of dpes to e configured
exceptionInfofor errors
void cpcConfigGenericFunctions_eventCommand ( string  textBox)
Adds system name to the dp if not present
Constraints
None
Usage
Public
PVSS managers
UI
Parameters
textBoxcontains the dp to be modified in its text attribute