Merge branch 'release/OpcSiemensRama05'
This commit is contained in:
@@ -331,6 +331,16 @@ namespace IOB_UT_NEXT
|
||||
/// </summary>
|
||||
public Dictionary<string, string> itemTranslation { get; set; } = new Dictionary<string, string>();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Indica se decodificare valori dall'area mMapRead da valori byte[] delle variabili sottoscritte
|
||||
/// </summary>
|
||||
public bool mMapReadFromRawByte { get; set; } = false;
|
||||
/// <summary>
|
||||
/// Indica se decodificare valori dall'area mMapWrite da valori byte[] delle variabili sottoscritte
|
||||
/// </summary>
|
||||
public bool mMapWriteFromRawByte { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Separatore configurazione area OPC e subObj in caso di memorie struct speciali
|
||||
/// </summary>
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
"BrowseValue": 0,
|
||||
"kvDelim": "#",
|
||||
"memDelim": ".",
|
||||
"mMapReadFromRawByte": true,
|
||||
"mMapWriteFromRawByte": false,
|
||||
"keyPartCount": "PV_Exchange_DB_R.Production#GEN.Float.0",
|
||||
"keyPartReq": "",
|
||||
"keyPartId": "",
|
||||
@@ -170,8 +172,8 @@
|
||||
"Spindle ": 2
|
||||
},
|
||||
"mMapRead": {
|
||||
"OPC_Enabled": {
|
||||
"name": "OPC_Enabled",
|
||||
"OPC_PV_Exchange_DB_R.Enabled": {
|
||||
"name": "OPC_PV_Exchange_DB_R.Enabled",
|
||||
"description": "Abilitazioni",
|
||||
"memAddr": "",
|
||||
"tipoMem": "Byte",
|
||||
@@ -182,10 +184,11 @@
|
||||
"factor": 1,
|
||||
"minVal": 0,
|
||||
"maxVal": 10,
|
||||
"unit": "#"
|
||||
"unit": "#",
|
||||
"displOrdinal": 101
|
||||
},
|
||||
"OPC_Fabric Run": {
|
||||
"name": "OPC_Fabric Run",
|
||||
"OPC_PV_Exchange_DB_R.Fabric Run": {
|
||||
"name": "OPC_PV_Exchange_DB_R.Fabric Run",
|
||||
"description": "Fabric Run",
|
||||
"memAddr": "",
|
||||
"tipoMem": "Byte",
|
||||
@@ -196,10 +199,11 @@
|
||||
"factor": 1,
|
||||
"minVal": 0,
|
||||
"maxVal": 10,
|
||||
"unit": "#"
|
||||
"unit": "#",
|
||||
"displOrdinal": 102
|
||||
},
|
||||
"OPC_Production": {
|
||||
"name": "OPC_Production",
|
||||
"OPC_PV_Exchange_DB_R.Production": {
|
||||
"name": "OPC_PV_Exchange_DB_R.Production",
|
||||
"description": "Stato Produzione",
|
||||
"memAddr": "",
|
||||
"tipoMem": "Byte",
|
||||
@@ -210,10 +214,11 @@
|
||||
"factor": 1,
|
||||
"minVal": 0,
|
||||
"maxVal": 10,
|
||||
"unit": "#"
|
||||
"unit": "#",
|
||||
"displOrdinal": 103
|
||||
},
|
||||
"OPC_Alarms": {
|
||||
"name": "OPC_Alarms",
|
||||
"OPC_PV_Exchange_DB_R.Alarms": {
|
||||
"name": "OPC_PV_Exchange_DB_R.Alarms",
|
||||
"description": "Allarmi",
|
||||
"memAddr": "",
|
||||
"tipoMem": "Byte",
|
||||
@@ -224,7 +229,173 @@
|
||||
"factor": 1,
|
||||
"minVal": 0,
|
||||
"maxVal": 10,
|
||||
"unit": "#"
|
||||
"unit": "#",
|
||||
"displOrdinal": 104
|
||||
},
|
||||
"OPC_Enab_EntryEnd": {
|
||||
"name": "OPC_Enab_EntryEnd",
|
||||
"description": "Entry End",
|
||||
"memAddr": "PV_Exchange_DB_R.Enabled#GEN.Byte.0",
|
||||
"tipoMem": "Boolean",
|
||||
"index": 0,
|
||||
"size": 1,
|
||||
"func": "POINT",
|
||||
"period": 90,
|
||||
"factor": 1,
|
||||
"minVal": 0,
|
||||
"maxVal": 10,
|
||||
"unit": "#",
|
||||
"displOrdinal": 11
|
||||
},
|
||||
"OPC_Enab_ExitEnd": {
|
||||
"name": "OPC_Enab_ExitEnd",
|
||||
"description": "Exit End",
|
||||
"memAddr": "PV_Exchange_DB_R.Enabled#GEN.Byte.1",
|
||||
"tipoMem": "Boolean",
|
||||
"index": 1,
|
||||
"size": 1,
|
||||
"func": "POINT",
|
||||
"period": 90,
|
||||
"factor": 1,
|
||||
"minVal": 0,
|
||||
"maxVal": 10,
|
||||
"unit": "#",
|
||||
"displOrdinal": 12
|
||||
},
|
||||
"OPC_Enab_SlowSpeed": {
|
||||
"name": "OPC_Enab_SlowSpeed",
|
||||
"description": "Slow Speed",
|
||||
"memAddr": "PV_Exchange_DB_R.Enabled#GEN.Byte.2",
|
||||
"tipoMem": "Boolean",
|
||||
"index": 2,
|
||||
"size": 1,
|
||||
"func": "POINT",
|
||||
"period": 90,
|
||||
"factor": 1,
|
||||
"minVal": 0,
|
||||
"maxVal": 10,
|
||||
"unit": "#",
|
||||
"displOrdinal": 13
|
||||
},
|
||||
"OPC_Enab_GenExhFan": {
|
||||
"name": "OPC_Enab_GenExhFan",
|
||||
"description": "Gen. Exhaust Fan",
|
||||
"memAddr": "PV_Exchange_DB_R.Enabled#GEN.Byte.3",
|
||||
"tipoMem": "Boolean",
|
||||
"index": 3,
|
||||
"size": 1,
|
||||
"func": "POINT",
|
||||
"period": 90,
|
||||
"factor": 1,
|
||||
"minVal": 0,
|
||||
"maxVal": 10,
|
||||
"unit": "#",
|
||||
"displOrdinal": 14
|
||||
},
|
||||
"OPC_Enab_GenFan": {
|
||||
"name": "OPC_Enab_GenFan",
|
||||
"description": "Gen. Fan",
|
||||
"memAddr": "PV_Exchange_DB_R.Enabled#GEN.Byte.4",
|
||||
"tipoMem": "Boolean",
|
||||
"index": 4,
|
||||
"size": 1,
|
||||
"func": "POINT",
|
||||
"period": 90,
|
||||
"factor": 1,
|
||||
"minVal": 0,
|
||||
"maxVal": 10,
|
||||
"unit": "#",
|
||||
"displOrdinal": 15
|
||||
},
|
||||
"OPC_Enab_GenBurn": {
|
||||
"name": "OPC_Enab_GenBurn",
|
||||
"description": "Gen. Burner",
|
||||
"memAddr": "PV_Exchange_DB_R.Enabled#GEN.Byte.5",
|
||||
"tipoMem": "Boolean",
|
||||
"index": 5,
|
||||
"size": 1,
|
||||
"func": "POINT",
|
||||
"period": 90,
|
||||
"factor": 1,
|
||||
"minVal": 0,
|
||||
"maxVal": 10,
|
||||
"unit": "#",
|
||||
"displOrdinal": 16
|
||||
},
|
||||
"OPC_Enab_AutoBurn": {
|
||||
"name": "OPC_Enab_AutoBurn",
|
||||
"description": "Auto Burner",
|
||||
"memAddr": "PV_Exchange_DB_R.Enabled#GEN.Byte.6",
|
||||
"tipoMem": "Boolean",
|
||||
"index": 6,
|
||||
"size": 1,
|
||||
"func": "POINT",
|
||||
"period": 90,
|
||||
"factor": 1,
|
||||
"minVal": 0,
|
||||
"maxVal": 10,
|
||||
"unit": "#",
|
||||
"displOrdinal": 17
|
||||
},
|
||||
"OPC_Enab_MispDet": {
|
||||
"name": "OPC_Enab_MispDet",
|
||||
"description": "Misp. Detector",
|
||||
"memAddr": "PV_Exchange_DB_R.Enabled#GEN.Byte.8",
|
||||
"tipoMem": "Boolean",
|
||||
"index": 8,
|
||||
"size": 1,
|
||||
"func": "POINT",
|
||||
"period": 90,
|
||||
"factor": 1,
|
||||
"minVal": 0,
|
||||
"maxVal": 10,
|
||||
"unit": "#",
|
||||
"displOrdinal": 19
|
||||
},
|
||||
"OPC_Fab_MacRun": {
|
||||
"name": "OPC_Fab_MacRun",
|
||||
"description": "Machine Run",
|
||||
"memAddr": "PV_Exchange_DB_R.Fabric Run#GEN.Byte.0",
|
||||
"tipoMem": "Boolean",
|
||||
"index": 0,
|
||||
"size": 1,
|
||||
"func": "POINT",
|
||||
"period": 90,
|
||||
"factor": 1,
|
||||
"minVal": 0,
|
||||
"maxVal": 10,
|
||||
"unit": "#",
|
||||
"displOrdinal": 21
|
||||
},
|
||||
"OPC_Fab_Chain": {
|
||||
"name": "OPC_Fab_Chain",
|
||||
"description": "Chain",
|
||||
"memAddr": "PV_Exchange_DB_R.Fabric Run#GEN.Byte.1",
|
||||
"tipoMem": "Boolean",
|
||||
"index": 1,
|
||||
"size": 1,
|
||||
"func": "POINT",
|
||||
"period": 90,
|
||||
"factor": 1,
|
||||
"minVal": 0,
|
||||
"maxVal": 10,
|
||||
"unit": "#",
|
||||
"displOrdinal": 22
|
||||
},
|
||||
"OPC_Fab_TORoll": {
|
||||
"name": "OPC_Fab_TORoll",
|
||||
"description": "Take Off Roller",
|
||||
"memAddr": "PV_Exchange_DB_R.Fabric Run#GEN.Byte.7",
|
||||
"tipoMem": "Boolean",
|
||||
"index": 7,
|
||||
"size": 1,
|
||||
"func": "POINT",
|
||||
"period": 90,
|
||||
"factor": 1,
|
||||
"minVal": 0,
|
||||
"maxVal": 10,
|
||||
"unit": "#",
|
||||
"displOrdinal": 22
|
||||
},
|
||||
"OPC_Prod_PartMetCount": {
|
||||
"name": "OPC_Prod_PartMetCount",
|
||||
@@ -238,7 +409,8 @@
|
||||
"factor": 1,
|
||||
"minVal": 0,
|
||||
"maxVal": 10,
|
||||
"unit": "m"
|
||||
"unit": "m",
|
||||
"displOrdinal": 1
|
||||
},
|
||||
"OPC_Prod_TotMetCount": {
|
||||
"name": "OPC_Prod_TotMetCount",
|
||||
@@ -252,7 +424,8 @@
|
||||
"factor": 1,
|
||||
"minVal": 0,
|
||||
"maxVal": 10,
|
||||
"unit": "m"
|
||||
"unit": "m",
|
||||
"displOrdinal": 2
|
||||
},
|
||||
"OPC_Prod_TotHourCount": {
|
||||
"name": "OPC_Prod_TotHourCount",
|
||||
@@ -266,7 +439,68 @@
|
||||
"factor": 1,
|
||||
"minVal": 0,
|
||||
"maxVal": 10,
|
||||
"unit": "m"
|
||||
"unit": "m",
|
||||
"displOrdinal": 3
|
||||
},
|
||||
"OPC_Prod_PartGasCount": {
|
||||
"name": "OPC_Prod_PartGasCount",
|
||||
"description": "Contatore Gas Parziale",
|
||||
"memAddr": "PV_Exchange_DB_R.Production#GEN.Float.12",
|
||||
"tipoMem": "FloatABCD",
|
||||
"index": 1,
|
||||
"size": 1,
|
||||
"func": "POINT",
|
||||
"period": 90,
|
||||
"factor": 1,
|
||||
"minVal": 0,
|
||||
"maxVal": 10,
|
||||
"unit": "nm3",
|
||||
"displOrdinal": 4
|
||||
},
|
||||
"OPC_Prod_TotGasCount": {
|
||||
"name": "OPC_Prod_TotGasCount",
|
||||
"description": "Contatore Gas Totale",
|
||||
"memAddr": "PV_Exchange_DB_R.Production#GEN.Float.16",
|
||||
"tipoMem": "FloatABCD",
|
||||
"index": 1,
|
||||
"size": 1,
|
||||
"func": "POINT",
|
||||
"period": 90,
|
||||
"factor": 1,
|
||||
"minVal": 0,
|
||||
"maxVal": 10,
|
||||
"unit": "nm3",
|
||||
"displOrdinal": 5
|
||||
},
|
||||
"OPC_Prod_PartElEnCount": {
|
||||
"name": "OPC_Prod_PartElEnCount",
|
||||
"description": "Contatore En Elettr. Parziale",
|
||||
"memAddr": "PV_Exchange_DB_R.Production#GEN.Float.20",
|
||||
"tipoMem": "FloatABCD",
|
||||
"index": 1,
|
||||
"size": 1,
|
||||
"func": "POINT",
|
||||
"period": 90,
|
||||
"factor": 1,
|
||||
"minVal": 0,
|
||||
"maxVal": 10,
|
||||
"unit": "kWh",
|
||||
"displOrdinal": 6
|
||||
},
|
||||
"OPC_Prod_TotElEnCount": {
|
||||
"name": "OPC_Prod_TotElEnCount",
|
||||
"description": "Contatore En Elettr. Totale",
|
||||
"memAddr": "PV_Exchange_DB_R.Production#GEN.Float.24",
|
||||
"tipoMem": "FloatABCD",
|
||||
"index": 1,
|
||||
"size": 1,
|
||||
"func": "POINT",
|
||||
"period": 90,
|
||||
"factor": 1,
|
||||
"minVal": 0,
|
||||
"maxVal": 10,
|
||||
"unit": "kWh",
|
||||
"displOrdinal": 7
|
||||
}
|
||||
},
|
||||
"mMapWrite": {
|
||||
|
||||
@@ -590,6 +590,14 @@ namespace IOB_WIN_NEXT.IobOpc
|
||||
// ora gestisco seconda parte...
|
||||
switch (currMem.Type)
|
||||
{
|
||||
case "Byte":
|
||||
bool bVal = false;
|
||||
if (bArray.Length > currMem.Idx)
|
||||
{
|
||||
bVal = bArray[currMem.Idx]==1;
|
||||
}
|
||||
answ = bVal ? "1" : "0";
|
||||
break;
|
||||
|
||||
case "Float":
|
||||
answ = $"{BitConverter.ToSingle(bArray, currMem.Idx)}";
|
||||
@@ -983,42 +991,50 @@ namespace IOB_WIN_NEXT.IobOpc
|
||||
accodaFLog(sVal, qEncodeFLog(descr, currVal));
|
||||
//accodaFLog(sVal, qEncodeFLog(descr, $"{NotifyValue}"));
|
||||
|
||||
// calcolo eventuali variazioni dati "collegati" in memRead/memWrite...
|
||||
if (memMap.mMapRead != null && memMap.mMapRead.Count > 0)
|
||||
// se abilitata decodifica area mMapRead da byte...
|
||||
if (opcUaParams.mMapReadFromRawByte)
|
||||
{
|
||||
// elenco aree collegate...
|
||||
var listRelated = memMap.mMapRead.Where(x => x.Value.memAddr.Contains(uuid)).ToList();
|
||||
if (listRelated != null && listRelated.Count() > 0)
|
||||
// calcolo eventuali variazioni dati "collegati" in memRead/memWrite...
|
||||
if (memMap.mMapRead != null && memMap.mMapRead.Count > 0)
|
||||
{
|
||||
foreach (var item in listRelated)
|
||||
// elenco aree collegate...
|
||||
var listRelated = memMap.mMapRead.Where(x => x.Value.memAddr.Contains(uuid)).ToList();
|
||||
if (listRelated != null && listRelated.Count() > 0)
|
||||
{
|
||||
// ciclo e calcolo valore
|
||||
var rByte = dataItemMem[uuid].rawByte;
|
||||
int iPos = item.Value.memAddr.IndexOf(opcUaParams.kvDelim);
|
||||
string varDef = item.Value.memAddr.Substring(iPos + 1);
|
||||
string convVal = ConvBArr(rByte, varDef, opcUaParams.memDelim);
|
||||
// metto in array currData...
|
||||
upsertKey(item.Key, convVal);
|
||||
accodaFLog($"mMapRead | {item.Key} | {convVal}", qEncodeFLog(item.Key, convVal));
|
||||
foreach (var item in listRelated)
|
||||
{
|
||||
// ciclo e calcolo valore
|
||||
var rByte = dataItemMem[uuid].rawByte;
|
||||
int iPos = item.Value.memAddr.IndexOf(opcUaParams.kvDelim);
|
||||
string varDef = item.Value.memAddr.Substring(iPos + 1);
|
||||
string convVal = ConvBArr(rByte, varDef, opcUaParams.memDelim);
|
||||
// metto in array currData...
|
||||
upsertKey(item.Key, convVal);
|
||||
accodaFLog($"mMapRead | {item.Key} | {convVal}", qEncodeFLog(item.Key, convVal));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (memMap.mMapWrite != null && memMap.mMapWrite.Count > 0)
|
||||
// se abilitata decodifica area mMapWrite da byte...
|
||||
if (opcUaParams.mMapWriteFromRawByte)
|
||||
{
|
||||
// elenco aree collegate...
|
||||
var listRelated = memMap.mMapWrite.Where(x => x.Value.memAddr.Contains(uuid)).ToList();
|
||||
if (listRelated != null && listRelated.Count() > 0)
|
||||
if (memMap.mMapWrite != null && memMap.mMapWrite.Count > 0)
|
||||
{
|
||||
foreach (var item in listRelated)
|
||||
// elenco aree collegate...
|
||||
var listRelated = memMap.mMapWrite.Where(x => x.Value.memAddr.Contains(uuid)).ToList();
|
||||
if (listRelated != null && listRelated.Count() > 0)
|
||||
{
|
||||
// ciclo e calcolo valore
|
||||
var rByte = dataItemMem[uuid].rawByte;
|
||||
int iPos = item.Value.memAddr.IndexOf(opcUaParams.kvDelim);
|
||||
string varDef = item.Value.memAddr.Substring(iPos + 1);
|
||||
string convVal = ConvBArr(rByte, varDef, opcUaParams.memDelim);
|
||||
// metto in array currData...
|
||||
upsertKey(item.Key, convVal);
|
||||
accodaFLog($"mMapRead | {item.Key} | {convVal}", qEncodeFLog(item.Key, convVal));
|
||||
foreach (var item in listRelated)
|
||||
{
|
||||
// ciclo e calcolo valore
|
||||
var rByte = dataItemMem[uuid].rawByte;
|
||||
int iPos = item.Value.memAddr.IndexOf(opcUaParams.kvDelim);
|
||||
string varDef = item.Value.memAddr.Substring(iPos + 1);
|
||||
string convVal = ConvBArr(rByte, varDef, opcUaParams.memDelim);
|
||||
// metto in array currData...
|
||||
upsertKey(item.Key, convVal);
|
||||
accodaFLog($"mMapRead | {item.Key} | {convVal}", qEncodeFLog(item.Key, convVal));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user