ssc_addKPINodes()
The function adds a plant model node of the type CNS_NODETYPE_KPI and links it to the KPI instance.
Synopsis
void ssc_addKPINodes(string node, string kpiName, string
kpiDPName);
Parameters
Parameters | Description |
---|---|
node | A plant model node to which the KPI node is added. |
kpiName | KPI name is used to generate a CNS node name. |
kpiDpName | The KPI instance DP to be linked to the node. |
Return Value
-
Description
The function adds a plant model node of the type CNS_NODETYPE_KPI and links it to a KPI instance. KPI instances are created for KPI definitions.
Example
The function adds a plant model node "Drive3" of the type CNS_NODETYPE_KPI to the plant model and links it to a KPI instance "kpi__Electric_Power0". The plant model node "Drive3" is added to the structure node "Hall1" (see figure further below). The KPI definition "Electric_Power" was created via the function ssc_defineKPI(). The instance "kpi__Electric_Power0" is an instance of the KPI definition "Electric_Power".
main()
{
string node= "System1.Plant:Hall1";
string kpiName = "Drive3";
string kpiDPName = "kpi__Electric_Power0";
ssc_addKPINodes(node,kpiName,kpiDPName);
if(""==kpiName)
{
DebugN("Enter a name for the node");
}
dyn_errClass errors = getLastError();
if(dynlen(errors)>0)
{
DebugN(errors);
}
else
DebugN("Node:",kpiName, "was added and linked to the KPI instance DP
", kpiDPName);
}
Assignment
Availability
SmartSCADA - wincc_oa_path/SmartSCADA_3.15/scripts/libs/SmartSCADA/kpi/kpiDefinition.ctl