Fix condizione controllo scrittura aprametri x vari adapter siemens + fix log
This commit is contained in:
@@ -2597,7 +2597,7 @@ namespace IOB_WIN_NEXT
|
||||
string jsonData = reader.ReadToEnd();
|
||||
if (!string.IsNullOrEmpty(jsonData))
|
||||
{
|
||||
lgInfo($"File json composto da {jsonData.Length} caratteri");
|
||||
lgInfo($"File json PARAMETRI composto da {jsonData.Length} caratteri");
|
||||
try
|
||||
{
|
||||
memMap = JsonConvert.DeserializeObject<plcMemMap>(jsonData);
|
||||
@@ -2629,7 +2629,7 @@ namespace IOB_WIN_NEXT
|
||||
string jsonData = reader.ReadToEnd();
|
||||
if (!string.IsNullOrEmpty(jsonData))
|
||||
{
|
||||
lgInfo($"File json composto da {jsonData.Length} caratteri");
|
||||
lgInfo($"File json ALLARMI composto da {jsonData.Length} caratteri");
|
||||
try
|
||||
{
|
||||
alarmMaps = JsonConvert.DeserializeObject<List<BaseAlarmConf>>(jsonData);
|
||||
@@ -2648,7 +2648,7 @@ namespace IOB_WIN_NEXT
|
||||
}
|
||||
else
|
||||
{
|
||||
lgInfo("loadMemConf: non trovata opzione PARAM_CONF in file INI");
|
||||
lgInfo("loadMemConf: non trovata opzione ALARM_CONF in file INI");
|
||||
}
|
||||
|
||||
// loggo
|
||||
@@ -2886,10 +2886,10 @@ namespace IOB_WIN_NEXT
|
||||
/// </summary>
|
||||
protected void setupMemMap()
|
||||
{
|
||||
lgInfo($"Decodifica aree memMap: trovati {memMap.mMapRead.Count} valori Read TSVC");
|
||||
lgInfo($"Decodifica aree memMap: trovati {memMap.mMapWrite.Count} parametri da scrivere");
|
||||
lgInfo($"setupMemMap | trovati {memMap.mMapRead.Count} parametri Read (TSVC)");
|
||||
lgInfo($"setupMemMap | trovati {memMap.mMapWrite.Count} parametri Write");
|
||||
string rawMemConf = JsonConvert.SerializeObject(memMap, Formatting.Indented);
|
||||
lgInfo($"Configurazione memoria R/W:{Environment.NewLine}{rawMemConf}");
|
||||
lgInfo($"setupMemMap | configurazione memoria R/W:{Environment.NewLine}{rawMemConf}");
|
||||
// se ho variabili read --> genero dati TSVC...
|
||||
if (memMap.mMapRead.Count > 0)
|
||||
{
|
||||
@@ -2954,6 +2954,7 @@ namespace IOB_WIN_NEXT
|
||||
// invio su cloud parametri!
|
||||
rawData = JsonConvert.SerializeObject(allParam);
|
||||
utils.callUrl($"{urlSaveAllParams}", rawData);
|
||||
lgInfo($"setupMemMap | salvata conf memoria R/W");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace IOB_WIN_NEXT
|
||||
string iobConfSer = "";
|
||||
try
|
||||
{
|
||||
iobConfSer = JsonConvert.SerializeObject(IOBConf);
|
||||
iobConfSer = JsonConvert.SerializeObject(IOBConf, Formatting.Indented);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
@@ -1143,7 +1143,7 @@ namespace IOB_WIN_NEXT
|
||||
switch (errorCode)
|
||||
{
|
||||
case ErrorCode.NoError:
|
||||
maybeLogWrite(memAddrWrite, $"Effettuata correttamente scrittura su PLC: MEMORIA {memAddrWrite} | numByte: {Value.Length} | BIN: {Value.ValToBinString()}");
|
||||
maybeLogWrite(memAddrWrite, $"S7WriteBB-01 Effettuata correttamente scrittura su PLC: MEMORIA {memAddrWrite} | numByte: {Value.Length} | BIN: {Value.ValToBinString()}");
|
||||
answ = true;
|
||||
break;
|
||||
|
||||
@@ -1206,7 +1206,7 @@ namespace IOB_WIN_NEXT
|
||||
switch (errorCode)
|
||||
{
|
||||
case ErrorCode.NoError:
|
||||
lgInfo($"Effettuata correttamente scrittura su PLC: DB {DbNum}.{IndiceMem} | numByte: {Value.Length}| {Value.ValToBinString()}");
|
||||
lgInfo($"S7WriteBB-02 Effettuata correttamente scrittura su PLC: DB {DbNum}.{IndiceMem} | numByte: {Value.Length}| {Value.ValToBinString()}");
|
||||
break;
|
||||
|
||||
case ErrorCode.WrongCPU_Type:
|
||||
@@ -1447,6 +1447,7 @@ namespace IOB_WIN_NEXT
|
||||
Buffer.BlockCopy(stringPar, 0, MemBlock, startPos, shiftStrByte);
|
||||
}
|
||||
Buffer.BlockCopy(strByte, 0, MemBlock, startPos + shiftStrByte, byteLen);
|
||||
lgInfo($"saveStringOnMemBlock: Final MemBlock{Environment.NewLine}{MemBlock.ValToBinString()}");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
|
||||
@@ -287,7 +287,7 @@ namespace IOB_WIN_NEXT
|
||||
taskDone.Add(item.Key, taskVal);
|
||||
if (!string.IsNullOrEmpty(memAddrWrite))
|
||||
{
|
||||
// scrivo comunque!
|
||||
// scrivo!
|
||||
taskOk = S7WriteBB(ref MemBlock, memAddrWrite);
|
||||
}
|
||||
if (!taskOk)
|
||||
|
||||
@@ -253,9 +253,9 @@ namespace IOB_WIN_NEXT
|
||||
}
|
||||
// aggiungo task!
|
||||
taskDone.Add(item.Key, taskVal);
|
||||
if (string.IsNullOrEmpty(memAddrWrite))
|
||||
if (!string.IsNullOrEmpty(memAddrWrite))
|
||||
{
|
||||
// scrivo comunque!
|
||||
// scrivo!
|
||||
taskOk = S7WriteBB(ref MemBlock, memAddrWrite);
|
||||
}
|
||||
if (!taskOk)
|
||||
|
||||
@@ -262,9 +262,9 @@ namespace IOB_WIN_NEXT
|
||||
}
|
||||
// aggiungo task!
|
||||
taskDone.Add(item.Key, taskVal);
|
||||
if (string.IsNullOrEmpty(memAddrWrite))
|
||||
if (!string.IsNullOrEmpty(memAddrWrite))
|
||||
{
|
||||
// scrivo comunque!
|
||||
// scrivo!
|
||||
taskOk = S7WriteBB(ref MemBlock, memAddrWrite);
|
||||
}
|
||||
if (!taskOk)
|
||||
|
||||
@@ -140,7 +140,7 @@ namespace IOB_WIN_NEXT
|
||||
/// <param name="task2exe"></param>
|
||||
public override Dictionary<string, string> executeTasks(Dictionary<string, string> task2exe)
|
||||
{
|
||||
lgInfo($"Chiamata executeTasks specifica IobSiemensComeca: {task2exe.Count} task ricevuti");
|
||||
lgInfo($"Chiamata executeTasks specifica IobSiemensCosmap: {task2exe.Count} task ricevuti");
|
||||
// Verificare il protocollo: dovrebeb togliere SOLO i task eseguiti...
|
||||
Dictionary<string, string> taskDone = new Dictionary<string, string>();
|
||||
bool taskOk = false;
|
||||
@@ -253,9 +253,9 @@ namespace IOB_WIN_NEXT
|
||||
}
|
||||
// aggiungo task!
|
||||
taskDone.Add(item.Key, taskVal);
|
||||
if (string.IsNullOrEmpty(memAddrWrite))
|
||||
if (!string.IsNullOrEmpty(memAddrWrite))
|
||||
{
|
||||
// scrivo comunque!
|
||||
// scrivo!
|
||||
taskOk = S7WriteBB(ref MemBlock, memAddrWrite);
|
||||
}
|
||||
if (!taskOk)
|
||||
|
||||
@@ -235,7 +235,7 @@ namespace IOB_WIN_NEXT
|
||||
taskDone.Add(item.Key, taskVal);
|
||||
if (!string.IsNullOrEmpty(memAddrWrite))
|
||||
{
|
||||
// scrivo comunque!
|
||||
// scrivo!
|
||||
taskOk = S7WriteBB(ref MemBlock, memAddrWrite);
|
||||
}
|
||||
if (!taskOk)
|
||||
|
||||
@@ -244,9 +244,9 @@ namespace IOB_WIN_NEXT
|
||||
}
|
||||
// aggiungo task!
|
||||
taskDone.Add(item.Key, taskVal);
|
||||
if (string.IsNullOrEmpty(memAddrWrite))
|
||||
if (!string.IsNullOrEmpty(memAddrWrite))
|
||||
{
|
||||
// scrivo comunque!
|
||||
// scrivo!
|
||||
taskOk = S7WriteBB(ref MemBlock, memAddrWrite);
|
||||
}
|
||||
if (!taskOk)
|
||||
|
||||
Reference in New Issue
Block a user