62 Commits

Author SHA1 Message Date
Samuele E. Locatelli ef83c4ad66 Fix contapezzi PLC x ModBus (dati float) 2022-09-16 17:16:32 +02:00
Samuele Locatelli b768a8d5aa Merge branch 'master' into FeatureOpcUaBaglietto 2022-09-16 16:23:39 +02:00
Samuele Locatelli 9a4c0a935d Merge branch 'develop' 2022-09-16 16:23:23 +02:00
Samuele Locatelli b2128bc23b Update modbus x HELPI e contapezzi 2022-09-16 16:23:13 +02:00
Samuele E. Locatelli 5b6d9d7801 Merge remote-tracking branch 'origin/develop' into FeatureOpcUaBaglietto 2022-09-12 10:30:19 +02:00
Samuele E. Locatelli 579b59e9d5 Fix conteggio messaggi allarme in avvio IOB 2022-09-12 10:29:45 +02:00
Samuele Locatelli 8504b8aef7 Merge branch 'develop' 2022-09-12 10:01:22 +02:00
Samuele Locatelli 7457fae6f8 Merge remote-tracking branch 'origin/FeatureOpcUaBaglietto' into develop 2022-09-12 10:01:15 +02:00
Samuele E. Locatelli ab106cc8c4 Merge remote-tracking branch 'origin/develop' into FeatureOpcUaBaglietto 2022-09-12 09:55:54 +02:00
zaccaria.majid 75f7a19418 correzione errori di battitura file
nel readme nella cartella utilityScripts
2022-09-12 09:14:32 +02:00
zaccaria.majid b20f37140d Merge branch 'FeatureOpcUaBaglietto' of https://gitlab.steamware.net/steamware/Mapo-IOB-WIN into FeatureOpcUaBaglietto 2022-09-12 08:41:50 +02:00
zaccaria.majid 663e8459d7 fix script per file csv 2022-09-12 08:40:08 +02:00
Samuele Locatelli f5f04c68d1 Allarmi OPC-UA:
- bozza recupero dati da provare
- setup Baglietto
2022-09-09 17:14:49 +02:00
Samuele Locatelli 30f0601a09 CodeMaid
- fix IobGeneric + IobModBusTCP
2022-09-09 17:09:06 +02:00
Samuele Locatelli 5ace8f2fac Gestione allarmi:
- spostato da ModBus/Siemens a IobGeneric metodo hasAlarms
- implementaizoni in override di base
2022-09-09 17:04:17 +02:00
Samuele Locatelli b1626b1381 Fix errore decoficia allarmi 8bit 2022-09-09 16:30:46 +02:00
Samuele E. Locatelli 47a796b945 Merge remote-tracking branch 'origin/develop' into FeatureOpcUaBaglietto 2022-09-09 15:53:50 +02:00
Samuele Locatelli acc0bf2734 UPdate readme + test export CIMOLAI 2022-09-09 15:50:59 +02:00
Samuele Locatelli c139c6e7ce Merge remote-tracking branch 'origin/FeatureOpcUaBaglietto' into develop 2022-09-09 15:32:42 +02:00
Samuele Locatelli de21437881 Readme iniziale 2022-09-09 15:32:18 +02:00
Samuele Locatelli 864c71a79f Spostsamento script in folder specifica 2022-09-09 15:32:12 +02:00
Samuele E. Locatelli 0c8ea6f344 Merge branch 'FeatureOpcUaBaglietto' of https://gitlab.steamware.net/steamware/Mapo-IOB-WIN into FeatureOpcUaBaglietto 2022-09-09 15:17:17 +02:00
Samuele E. Locatelli 52268e633c Fix filtraggio valori BLINK
- Baglietto (NONE)
- FInassi (131, B0,B1,B7)
2022-09-09 15:17:07 +02:00
Samuele Locatelli c95eacf22b Merge remote-tracking branch 'origin/FeatureOpcUaBaglietto' into develop 2022-09-09 15:09:21 +02:00
zaccaria.majid fba5879902 fix script 2022-09-09 12:42:17 +02:00
zaccaria.majid d1db6dbefc Merge branch 'FeatureOpcUaBaglietto' of https://gitlab.steamware.net/steamware/Mapo-IOB-WIN into FeatureOpcUaBaglietto 2022-09-09 12:27:46 +02:00
zaccaria.majid d6e9371d24 completamento script automazione+fix file allarmi 2022-09-09 12:27:40 +02:00
Samuele E. Locatelli cd99295817 Merge branch 'develop' into FeatureOpcUaBaglietto 2022-09-08 19:25:01 +02:00
Samuele Locatelli d7690b8d1d Merge branch 'develop' of https://gitlab.steamware.net/steamware/Mapo-IOB-WIN into develop 2022-09-08 19:23:41 +02:00
Samuele Locatelli d2b46deff1 Merge tag 'RealignPostCodeMaid' into develop
Riallineamento post CodeMaid globale
2022-09-08 19:23:15 +02:00
Samuele Locatelli 93b2199f1c Merge branch 'release/RealignPostCodeMaid' 2022-09-08 19:23:01 +02:00
Samuele Locatelli 0a5b05467a CodeMaid:
- ancora update... principalmente siemens S7
2022-09-08 19:22:26 +02:00
Samuele Locatelli b09576f91a CodeMaid: ancora update struttura 2022-09-08 19:11:47 +02:00
Samuele Locatelli 6a2ca75de7 CodeMaid:
- ancora update struttura codice IOB-WIN-NEXT
2022-09-08 19:04:48 +02:00
Samuele Locatelli d37d71c51d CodeMaid:
- ancora fix librerie base IOB-UT-NEXT
2022-09-08 18:52:30 +02:00
Samuele Locatelli 3a7eff3554 Refactor CodeMaid classi ultime toccate 2022-09-08 18:47:43 +02:00
Samuele Locatelli 1e9fe1be3d Merge remote-tracking branch 'origin/FeatureOpcUaBaglietto' into develop 2022-09-08 18:43:48 +02:00
Samuele E. Locatelli f270bac1db Merge branch 'develop' of https://gitlab.steamware.net/steamware/Mapo-IOB-WIN into develop 2022-09-08 18:43:37 +02:00
Samuele E. Locatelli c609e7644e Merge branch 'FeatureOpcUaBaglietto' into develop 2022-09-08 18:43:27 +02:00
Samuele E. Locatelli 0901fabe62 Merge tag 'OpcUacPingRetry' into develop
Update codice
2022-09-08 18:43:09 +02:00
Samuele E. Locatelli 61341e2ab8 Merge branch 'FeatureOpcUaBaglietto' of https://gitlab.steamware.net/steamware/Mapo-IOB-WIN into FeatureOpcUaBaglietto 2022-09-08 18:42:57 +02:00
Samuele E. Locatelli d8262e82e9 update conf x baglietto x RunMode 2022-09-08 18:42:48 +02:00
Samuele E. Locatelli 0b0ec306b3 Aggiunto metodo x processing runMode con traduzione 2022-09-08 18:42:38 +02:00
Samuele Locatelli 09dcff9303 Fix pulizia area conf in yaml 2022-09-08 18:42:00 +02:00
Samuele E. Locatelli a28c0acc48 Merge branch 'hotfix/OpcUacPingRetry' 2022-09-08 16:45:42 +02:00
Samuele E. Locatelli 2211fc284d OPC-UA
- aggiunto retry ping con wait random
- conf Finassi e Baglietto x usare questo ritardo e retry
2022-09-08 16:44:01 +02:00
zaccaria.majid 88089c5a7c modifica guppi 2022-09-08 15:02:20 +02:00
zaccaria.majid 1dd6ca4511 Merge branch 'FeatureOpcUaBaglietto' of https://gitlab.steamware.net/steamware/Mapo-IOB-WIN into FeatureOpcUaBaglietto 2022-09-08 14:53:42 +02:00
zaccaria.majid 41e276f069 fine compilazione conf allarmi baglietto 2022-09-08 14:53:32 +02:00
Samuele E. Locatelli 90f735ceb0 OPC-UA:
- modifica gestione file conf XML base x client
2022-09-08 11:58:25 +02:00
Samuele E. Locatelli f0a0e0cb2d Merge remote-tracking branch 'origin/develop' into FeatureOpcUaBaglietto 2022-09-08 11:27:35 +02:00
Samuele Locatelli 1aa4f7da12 Merge remote-tracking branch 'origin/FeatureOpcUaBaglietto' 2022-09-08 11:26:47 +02:00
Samuele E. Locatelli 3c5004253d Test x OMP... 2022-09-08 11:25:39 +02:00
Samuele E. Locatelli 9f7bfebf97 Fix configurazione x OMP FInassi 2022-09-08 11:25:07 +02:00
Samuele E. Locatelli 1e7bf45e8b Cimolai:
- conf OPC-UA ora è corretta (da completare)
2022-09-07 18:36:16 +02:00
Samuele E. Locatelli 1cb0bc84b1 OPC-UA Cimolai:
- conf OPC-UA aggiornata
- fix gestione contapezzi
2022-09-07 18:29:52 +02:00
zaccaria.majid f82824fc41 Compilazione parte di file configurazione allarmi 2022-09-07 17:38:39 +02:00
Samuele E. Locatelli dfe57d73de Setup preliminare conf allarmi 2022-09-07 12:29:46 +02:00
Samuele E. Locatelli 1502588443 Priam release OPC Cimolai (replica da OMP) 2022-09-07 12:17:18 +02:00
Samuele E. Locatelli afa2b2b069 Fix x remote debug Baglietto 2022-09-07 12:17:01 +02:00
Samuele E. Locatelli 04d42a0bc1 Prima conf di test x Cimolai 2022-09-07 12:16:46 +02:00
Samuele E. Locatelli 0ea4e7e122 Aggiunta conf x OPC MBH CImolai 2022-09-07 12:16:30 +02:00
85 changed files with 10654 additions and 7816 deletions
+1 -1
View File
@@ -93,7 +93,7 @@ variables:
$Target = "Releases\" + $CI_COMMIT_BRANCH + "\" + $env:APP_NAME + ".zip"
cd "$env:APP_NAME\bin\"
$Source = "*"
7zip a -tzip $Target $Source -xr!DATA
7zip a -tzip $Target $Source -xr!DATA\CONF
echo "called ZIP $Source --> $Target"
# helper creazione hash files
+10
View File
@@ -363,6 +363,16 @@ namespace IOB_UT_NEXT
/// </summary>
OpcUaEwonMecolpress,
/// <summary>
/// Adapter MBH (es Cimolai)
/// </summary>
OpcUaMBH,
/// <summary>
/// Adapter MBH implementazione Cimolai x travel lift
/// </summary>
OpcUaMBHCimolai,
/// <summary>
/// Adapter OMRON (es ICOEL)
/// </summary>
+2 -2
View File
@@ -78,8 +78,8 @@
<Reference Include="ICSharpCode.SharpZipLib, Version=1.3.1.9, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
<HintPath>..\packages\SharpZipLib.1.3.1\lib\net45\ICSharpCode.SharpZipLib.dll</HintPath>
</Reference>
<Reference Include="MapoSDK, Version=6.14.2207.2913, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MapoSDK.6.14.2207.2913\lib\MapoSDK.dll</HintPath>
<Reference Include="MapoSDK, Version=6.14.2209.916, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MapoSDK.6.14.2209.916\lib\MapoSDK.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.6.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
-4
View File
@@ -16,7 +16,6 @@ namespace IOB_UT_NEXT
#endregion Public Fields
#region Public Constructors
/// <summary>
@@ -253,9 +252,6 @@ namespace IOB_UT_NEXT
#region Private Methods
// INI filename
/// <summary>
/// GetPrivateProfileInt: import windows dll functions
/// </summary>
+5 -5
View File
@@ -55,6 +55,11 @@ namespace IOB_UT_NEXT
/// </summary>
public DateTime lastUpdate { get; set; } = DateTime.Now.AddDays(-1);
/// <summary>
/// Valore minimo da considerare come delta secondi x indicare variazione sui dati temporali
/// </summary>
public int minDeltaSec { get; set; } = 5;
/// <summary>
/// Status del SINGOLO IOB
/// </summary>
@@ -105,11 +110,6 @@ namespace IOB_UT_NEXT
/// </summary>
public Dictionary<string, string> setupParams { get; set; } = new Dictionary<string, string>();
/// <summary>
/// Valore minimo da considerare come delta secondi x indicare variazione sui dati temporali
/// </summary>
public int minDeltaSec { get; set; } = 5;
#endregion Public Properties
#region Public Methods
+2 -6
View File
@@ -65,8 +65,6 @@ namespace IOB_UT_NEXT
/// </summary>
public class BaseRawTransf
{
#region Public Properties
/// <summary>
/// Data-Ora riferimento (x ordinamento fifo)
/// </summary>
@@ -104,9 +102,7 @@ namespace IOB_UT_NEXT
this.mesContent = mesContent;
this.mesType = mesType;
}
#endregion Public Properties
}
}
#endif
/// <summary>
@@ -813,7 +809,7 @@ namespace IOB_UT_NEXT
public int Period { get; set; } = 60;
/// <summary>
/// UM parametro, impiegato anche x conversione (es epoch --> datetime)
/// UM parametro, impiegato anche x conversione (es epoch --&gt; datetime)
/// </summary>
public string UM { get; set; } = "";
+8 -6
View File
@@ -26,7 +26,9 @@ namespace IOB_UT_NEXT
/// <param name="codServer">IP/nome server</param>
/// <param name="codIob">Cod IOB</param>
/// <param name="tipoIob">Tipo di IOB</param>
/// <param name="minDeltaS">Minima differenza in secondi x considerare variazione dati DataOra</param>
/// <param name="minDeltaS">
/// Minima differenza in secondi x considerare variazione dati DataOra
/// </param>
public RedisIobCache(string codServer, string codIob, string tipoIob, int minDeltaS)
{
// init dati di base...
@@ -1105,16 +1107,16 @@ namespace IOB_UT_NEXT
/// </summary>
protected string currIobType = "ND";
/// <summary>
/// Hash REDIS x dati IOB
/// </summary>
protected string redIobKey = "";
/// <summary>
/// Nome del channel REDIS x dati IOB
/// </summary>
protected string redIobChannel = "IobChannel";
/// <summary>
/// Hash REDIS x dati IOB
/// </summary>
protected string redIobKey = "";
/// <summary>
/// Hash REDIS x dati server
/// </summary>
+6 -6
View File
@@ -1,18 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IOB_UT_NEXT
{
public class TimeUtils
{
#region Public Methods
public static DateTime epochConvert(double epoch)
{
DateTime date = new DateTime(1970, 1, 1, 0, 0, 0, 0); //from start epoch time
DateTime date = new DateTime(1970, 1, 1, 0, 0, 0, 0); //from start epoch time
date = date.AddSeconds(epoch);
return date;
}
#endregion Public Methods
}
}
}
+30 -4
View File
@@ -166,9 +166,20 @@ namespace IOB_UT_NEXT
/// </summary>
public void setupData()
{
// inizializzo vettore valore allarmi x banco int16
alarmsState = new uint[size / 2];
alarmsMask = new uint[size / 2];
// inizializzo vettore valore allarmi x banco int8 x iniziare
alarmsState = new uint[size];
alarmsMask = new uint[size];
int bitSize = 8;
// 16/32 bit
if (size > 1)
{
// inizializzo vettore valore allarmi x banco int16
alarmsState = new uint[size / 2];
alarmsMask = new uint[size / 2];
bitSize = 16;
}
// una volta inizializzata la classe di base sistemo vettori allarmi disabilitati ed il
// contatore blink dei fronti di discesa
@@ -188,7 +199,7 @@ namespace IOB_UT_NEXT
}
idx++;
// sistemo bank/indice
if (idx > 15)
if (idx > bitSize - 1)
{
bank++;
idx = 0;
@@ -234,6 +245,11 @@ namespace IOB_UT_NEXT
/// </summary>
public List<string> fluxLogVeto { get; set; } = new List<string>();
/// <summary>
/// Indica se il controllo di ping sia OK (x controllo prima della connessione)
/// </summary>
public bool forcePingOk { get; set; } = false;
/// <summary>
/// Array degli elementi di traduzione item
/// </summary>
@@ -279,6 +295,16 @@ namespace IOB_UT_NEXT
/// </summary>
public bool pingAsPowerOn { get; set; } = true;
/// <summary>
/// Indica se venga richiesta invio del run mode
/// </summary>
public bool runModeSend { get; set; } = false;
/// <summary>
/// Indica se venga richiesta traduzione del run mode
/// </summary>
public bool runModeTrad { get; set; } = false;
#endregion Public Properties
}
+3 -3
View File
@@ -41,15 +41,15 @@ namespace IOB_UT_NEXT
/// </summary>
public static bool MPIO_Online = false;
#endregion Public Fields
#if false
/// <summary>
/// Oggetto connessione REDIS
/// </summary>
public static RedisIobCache redisMan = new RedisIobCache();
public static RedisIobCache redisMan = new RedisIobCache();
#endif
#endregion Public Fields
#region Public Properties
/// <summary>
+149 -146
View File
@@ -13,15 +13,6 @@ namespace IOB_UT_NEXT
/// </summary>
public class fileMover
{
#region Protected Fields
/// <summary>
/// path di lavoro dei metodi leggi/scrivi
/// </summary>
protected string _workPath;
#endregion Protected Fields
#region Public Fields
/// <summary>
@@ -42,7 +33,7 @@ namespace IOB_UT_NEXT
/// inizializza il metodo alla cartella indicata
/// </summary>
/// <param name="_path"></param>
/// <param name="_log">non serve +... x retrocompatibilità...</param>
/// <param name="_log">non serve +... x retrocompatibilit...</param>
public fileMover(string _path, string _log)
{
setDirs(_path);
@@ -59,111 +50,6 @@ namespace IOB_UT_NEXT
#endregion Public Constructors
#region Private Methods
/// <summary>
/// cerca di caricare la directoryInfo o da httpcontext-application re-position o direttamente come workpath
/// </summary>
/// <returns></returns>
private DirectoryInfo getDirectoryInfo()
{
DirectoryInfo _di;
_di = new DirectoryInfo(_workPath);
return _di;
}
/// <summary>
/// Recupera oggetto DirInfo da path
/// </summary>
/// <param name="path"></param>
/// <returns></returns>
private DirectoryInfo getDirectoryInfo(string path)
{
DirectoryInfo _di = new DirectoryInfo(path);
return _di;
}
/// <summary>
/// cerca di caricare il fileinfo o da httpcontext-application re-position o direttamente come workpath + nomefile
/// </summary>
/// <param name="_fullPath">path completo file</param>
/// <returns></returns>
private FileInfo getFileInfoByName(string _fullPath)
{
FileInfo _fi;
_fi = new FileInfo(_fullPath);
return _fi;
}
/// <summary>
/// cerca di caricare il fileinfo o da httpcontext-application re-position o direttamente come workpath + nomefile
/// </summary>
/// <param name="_path">cartella file</param>
/// <param name="_nomeFile">nome file</param>
/// <returns></returns>
private FileInfo getFileInfoByName(string _path, string _nomeFile)
{
FileInfo _fi;
_fi = new FileInfo(_path + "\\" + _nomeFile);
return _fi;
}
/// <summary>
/// setta le directory
/// </summary>
/// <param name="_path"></param>
private void setDirs(string _path)
{
_workPath = _path;
}
#endregion Private Methods
#region Protected Methods
/// <summary>
/// converte un byte[] in una string
/// </summary>
/// <param name="_array"></param>
/// <returns></returns>
protected string byteToStr(byte[] _array)
{
System.Text.ASCIIEncoding encod = new System.Text.ASCIIEncoding();
return encod.GetString(_array);
}
/// <summary>
/// converte una string in un byte[]
/// </summary>
/// <param name="_val"></param>
/// <returns></returns>
protected byte[] strToByte(string _val)
{
System.Text.ASCIIEncoding encod = new System.Text.ASCIIEncoding();
return encod.GetBytes(_val);
}
/// <summary>
/// verifica esistenza directory ed eventualmente crea restituendo nome completo di "/" finale
/// </summary>
/// <param name="_path"></param>
/// <returns></returns>
protected string verDir(string _path)
{
DirectoryInfo di = getDirectoryInfo(_path);
if (!di.Exists)
{
di.Create();
}
if (!_path.EndsWith("/") && !_path.EndsWith(@"\"))
{
_path += "/";
}
return _path;
}
#endregion Protected Methods
#region Public Methods
/// <summary>
@@ -253,16 +139,15 @@ namespace IOB_UT_NEXT
}
/// <summary>
/// Legge i dati da uno stream fino a quando arriva alla fine.
/// I dati sono restituiti come un byte[] array. un eccezione IOException è
/// sollevata se una delle chiamate IO sottostanti fallisce.
/// Legge i dati da uno stream fino a quando arriva alla fine. I dati sono restituiti come
/// un byte[] array. Un eccezione IOException viene sollevata se una delle chiamate IO
/// sottostanti fallisce.
/// </summary>
/// <param name="stream">Lo stream da cui leggere</param>
/// <param name="initialLength">Lunghezza buffer iniziale (-1 = default 32k)</param>
public static byte[] ReadFully(Stream stream, int initialLength)
{
// If we've been passed an unhelpful initial length, just
// use 32K.
// If we've been passed an unhelpful initial length, just use 32K.
if (initialLength < 1)
{
initialLength = 32768;
@@ -276,8 +161,7 @@ namespace IOB_UT_NEXT
{
read += chunk;
// If we've reached the end of our buffer, check to see if there's
// any more information
// If we've reached the end of our buffer, check to see if there's any more information
if (read == buffer.Length)
{
int nextByte = stream.ReadByte();
@@ -288,8 +172,7 @@ namespace IOB_UT_NEXT
return buffer;
}
// Nope. Resize the buffer, put in the byte we've just
// read, and continue
// Nope. Resize the buffer, put in the byte we've just read, and continue
byte[] newBuffer = new byte[buffer.Length * 2];
Array.Copy(buffer, newBuffer, buffer.Length);
newBuffer[read] = (byte)nextByte;
@@ -513,6 +396,25 @@ namespace IOB_UT_NEXT
return fatto;
}
/// <summary>
/// Elimina i file + vecchi di maxNumDays giorni
/// </summary>
/// <returns></returns>
public void deleteOlderThan(int maxNumDays)
{
DirectoryInfo _di = checkDir();
FileInfo[] _fis = _di.GetFiles();
DateTime dateLimit = DateTime.Now.AddDays(-maxNumDays);
try
{
_fis.Where(x => x.LastWriteTime < dateLimit).ToList().ForEach(x => x.Delete());
}
catch (Exception exc)
{
Logging.Instance.Error($"Eccezione in deleteOlderThan{Environment.NewLine}{exc}");
}
}
/// <summary>
/// elimina il file + vecchio
/// </summary>
@@ -541,24 +443,6 @@ namespace IOB_UT_NEXT
catch
{ }
}
/// <summary>
/// Elimina i file + vecchi di maxNumDays giorni
/// </summary>
/// <returns></returns>
public void deleteOlderThan(int maxNumDays)
{
DirectoryInfo _di = checkDir();
FileInfo[] _fis = _di.GetFiles();
DateTime dateLimit = DateTime.Now.AddDays(-maxNumDays);
try
{
_fis.Where(x => x.LastWriteTime <dateLimit).ToList().ForEach(x => x.Delete());
}
catch(Exception exc)
{
Logging.Instance.Error($"Eccezione in deleteOlderThan{Environment.NewLine}{exc}");
}
}
/// <summary>
/// elenco dei files come array di oggetti FileInfo
@@ -582,7 +466,7 @@ namespace IOB_UT_NEXT
}
/// <summary>
/// elimina la directory di lavoro se è dir virtuale mappata
/// elimina la directory di lavoro se dir virtuale mappata
/// </summary>
/// <returns></returns>
public bool eliminaDir()
@@ -852,7 +736,7 @@ namespace IOB_UT_NEXT
/// imposta la dir di lavoro
/// </summary>
/// <param name="_path"></param>
/// <param name="_log">non serve +... x retrocompatibilità...</param>
/// <param name="_log">non serve +... x retrocompatibilit...</param>
public void setDirectory(string _path, string _log)
{
setDirs(_path);
@@ -911,7 +795,8 @@ namespace IOB_UT_NEXT
{
s.SetLevel(5);
byte[] buffer = new byte[4096];
// effettuo una ricerca dei files corrispondenti al criterio regexp, e per ognuno effettuo inserimento in zipfile...
// effettuo una ricerca dei files corrispondenti al criterio regexp, e per
// ognuno effettuo inserimento in zipfile...
FileInfo[] filesTrovati = elencoFiles_FI(regExp);
ZipEntry entry;
foreach (FileInfo _fi in filesTrovati)
@@ -923,7 +808,8 @@ namespace IOB_UT_NEXT
s.PutNextEntry(entry);
using (FileStream fs = File.OpenRead(_fi.FullName))
{
// Using a fixed size buffer here makes no noticeable difference for output but keeps a lid on memory usage.
// Using a fixed size buffer here makes no noticeable difference for
// output but keeps a lid on memory usage.
int sourceBytes;
do
{
@@ -1026,5 +912,122 @@ namespace IOB_UT_NEXT
}
#endregion Public Methods
#region Protected Fields
/// <summary>
/// path di lavoro dei metodi leggi/scrivi
/// </summary>
protected string _workPath;
#endregion Protected Fields
#region Protected Methods
/// <summary>
/// converte un byte[] in una string
/// </summary>
/// <param name="_array"></param>
/// <returns></returns>
protected string byteToStr(byte[] _array)
{
System.Text.ASCIIEncoding encod = new System.Text.ASCIIEncoding();
return encod.GetString(_array);
}
/// <summary>
/// converte una string in un byte[]
/// </summary>
/// <param name="_val"></param>
/// <returns></returns>
protected byte[] strToByte(string _val)
{
System.Text.ASCIIEncoding encod = new System.Text.ASCIIEncoding();
return encod.GetBytes(_val);
}
/// <summary>
/// verifica esistenza directory ed eventualmente crea restituendo nome completo di "/" finale
/// </summary>
/// <param name="_path"></param>
/// <returns></returns>
protected string verDir(string _path)
{
DirectoryInfo di = getDirectoryInfo(_path);
if (!di.Exists)
{
di.Create();
}
if (!_path.EndsWith("/") && !_path.EndsWith(@"\"))
{
_path += "/";
}
return _path;
}
#endregion Protected Methods
#region Private Methods
/// <summary>
/// cerca di caricare la directoryInfo o da httpcontext-application re-position o
/// direttamente come workpath
/// </summary>
/// <returns></returns>
private DirectoryInfo getDirectoryInfo()
{
DirectoryInfo _di;
_di = new DirectoryInfo(_workPath);
return _di;
}
/// <summary>
/// Recupera oggetto DirInfo da path
/// </summary>
/// <param name="path"></param>
/// <returns></returns>
private DirectoryInfo getDirectoryInfo(string path)
{
DirectoryInfo _di = new DirectoryInfo(path);
return _di;
}
/// <summary>
/// cerca di caricare il fileinfo o da httpcontext-application re-position o direttamente
/// come workpath + nomefile
/// </summary>
/// <param name="_fullPath">path completo file</param>
/// <returns></returns>
private FileInfo getFileInfoByName(string _fullPath)
{
FileInfo _fi;
_fi = new FileInfo(_fullPath);
return _fi;
}
/// <summary>
/// cerca di caricare il fileinfo o da httpcontext-application re-position o direttamente
/// come workpath + nomefile
/// </summary>
/// <param name="_path">cartella file</param>
/// <param name="_nomeFile">nome file</param>
/// <returns></returns>
private FileInfo getFileInfoByName(string _path, string _nomeFile)
{
FileInfo _fi;
_fi = new FileInfo(_path + "\\" + _nomeFile);
return _fi;
}
/// <summary>
/// setta le directory
/// </summary>
/// <param name="_path"></param>
private void setDirs(string _path)
{
_workPath = _path;
}
#endregion Private Methods
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MapoSDK" version="6.14.2207.2913" targetFramework="net462" />
<package id="MapoSDK" version="6.14.2209.916" targetFramework="net462" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="6.0.0" targetFramework="net462" />
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net462" />
<package id="NLog" version="4.7.13" targetFramework="net462" />
File diff suppressed because it is too large Load Diff
+2 -6
View File
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace IOB_WIN_NEXT
@@ -15,7 +11,7 @@ namespace IOB_WIN_NEXT
{
#region Public Methods
static public void UIThread(this Control control, Action code)
public static void UIThread(this Control control, Action code)
{
if (control.InvokeRequired)
{
@@ -25,7 +21,7 @@ namespace IOB_WIN_NEXT
code.Invoke();
}
static public void UIThreadInvoke(this Control control, Action code)
public static void UIThreadInvoke(this Control control, Action code)
{
if (control.InvokeRequired)
{
@@ -0,0 +1,72 @@
;Configurazione IOB-WIN
[IOB]
;Travel Lift CIMOLAI (https://www.cimolaitechnology.com/it/products/) con controllo MBH OpcUa
CNCTYPE=OpcUaMBHCimolai
PING_MS_TIMEOUT=500
[MACHINE]
VENDOR=CIMOLAI
MODEL=Travel Lift
[CNC]
IP=192.168.60.234
PORT=48010
GETPRGNAME=true
[SERVER]
MPIP=http://192.168.60.15
MPURL=/MP/IO
CMDBASE=/IOB/input/
CMDFLOG=/IOB/flog/
CMDALIVE=/IOB
CMDENABLED=/IOB/enabled/
CMDADV1=?valore=
CMDREBO=/sendReboot.aspx?idxMacchina=
[MEMORY]
ADDR_READ=DB9999.DBB0
ADDR_WRITE=DB9999.DBB0
SIZE_READ=0
SIZE_WRITE=0
[BLINK]
;MAX_COUNTER_BLINK = 30
MAX_COUNTER_BLINK = 15
;bit0 = 0
;bit1 = 0
;bit2 = 1
;bit3 = 1
;bit4 = 1
;bit5 = 0
;bit6 = 0
;bit7 = 0
;BLINK_FILT=28
BLINK_FILT=0
[OPTPAR]
AUTO_CHANGE_ODL=false
CHANGE_ODL_MODE=TIME
CHANGE_ODL_HOURS=24
CHANGE_ODL_IDLE_MIN=5
PZCOUNT_MODE=OPC
DISABLE_PZCOUNT=TRUE
ENABLE_SEND_PZC_BLOCK=TRUE
MIN_SEND_PZC_BLOCK=0
MAX_SEND_PZC_BLOCK=100
ENABLE_DYN_DATA=FALSE
FORCE_DYN_DATA=TRUE
ENABLE_DATA_FILTER=TRUE
ENABLE_CLI_RESTART=TRUE
MAX_TRY_PING=3
;NO_PING=FALSE
; conf aree allarme
ALARM_CONF=BAGLIETTO_CIMOLAI_01_alarm.json
; conf parametri memoria READ/WRITE
OPC_PARAM_CONF=BAGLIETTO_CIMOLAI_01.json
[BRANCH]
NAME=master
@@ -0,0 +1,130 @@
{
"BrowseFullVal": "ns=2;i=1001",
"BrowseNSIndex": 2,
"BrowseValue": 1001,
"keyPartCount": "",
"keyPartReq": "",
"keyPartId": "",
"keyProgName": "",
"keyRunMode": "PLC/DB231/Attivita",
"pingAsPowerOn": true,
"forcePingOk": false,
"translRunMode": true,
"condWork": [
{
"keyName": "PLC/DB13/Gen/Marcia_AUX",
"targetValue": "2"
},
{
"keyName": "PLC/DB231/InCorso",
"targetValue": "1"
}
],
"condPowerOn": {
"checkMode": "AND",
"checkList": []
},
"condReady": {
"checkMode": "AND",
"checkList": [
{
"keyName": "PLC/DB13/Gen/Marcia_AUX",
"targetValue": "2"
}
]
},
"condManual": {
"checkMode": "AND",
"checkList": []
},
"condEStop": {
"checkMode": "AND",
"checkList": []
},
"condError": {
"checkMode": "OR",
"checkList": [
{
"keyName": "PLC/DB13/Gen/ComProfibusMessage",
"targetValue": "1"
},
{
"keyName": "PLC/DB13/Gen/ComProfibusMessage",
"targetValue": "3"
},
{
"keyName": "PLC/DB13/Gen/Hydraulic_Unit",
"targetValue": "3"
},
{
"keyName": "PLC/DB13/Gen/Marcia_AUX",
"targetValue": "1"
},
{
"keyName": "PLC/DB13/Gen/Wheel_Fault",
"targetValue": "3"
}
]
},
"condCountEnabled": {
"checkMode": "AND",
"checkList": []
},
"condWarmUpCoolDown": {
"checkMode": "OR",
"checkList": [],
"negateValue": true
},
"condWarning": {
"checkMode": "AND",
"checkList": []
},
"condSetup": {
"checkMode": "AND",
"checkList": []
},
"fluxLogVeto": [
""
],
"itemTranslation": {
"fdovrd": "PATH FEED OVERRIDE",
"rovrd": "PATH RAPID OVERRIDE",
"RunMode_1": "Avvio Registrazione Ricetta",
"RunMode_2": "Inizio Comando Traslazione",
"RunMode_3": "Termine Comando Traslazione",
"RunMode_4": "Inizio Comando Sterzatura",
"RunMode_5": "Termine Comando Sterzatura",
"RunMode_6": "Inizio Comando Movimento Carrelli",
"RunMode_7": "Termine Comando Movimento Carrelli",
"RunMode_8": "Inizio Comando Sollevamento",
"RunMode_9": "Termine Comando Sollevamento"
},
"paramsEndThresh": {
"InvDDone": 50
},
"mMapWrite": {
"setPzComm": {
"name": "setPzComm",
"description": "Qty",
"tipoMem": "Int",
"memAddr": "ns=4;i=11",
"index": 0,
"size": 4
},
"setProg": {
"name": "setProg",
"description": "Programma",
"tipoMem": "String",
"memAddr": "ns=4;i=9",
"index": 0,
"size": 30
}
},
"subscribedItems": [],
"WatchDog": {
"IsEnabled": false,
"MemConfRead": "ns=4;s=tomes_1_Watchdog",
"MemConfWrite": "ns=4;s=tomach_1_watchdog",
"MaxVal": 9999
}
}
@@ -0,0 +1,664 @@
[
{
"description": "Profinet Byte_00",
"tipoMem": "Byte",
"memAddr": "All_Byte_B0",
"index": 0,
"size": 1,
"messages": [
"Allarme comunicazione profinet - I/O GT2",
"Allarme comunicazione profinet - Sistema di pesatura",
"Allarme comunicazione - Ricevente radiocomando",
"Allarme comunicazione CanOpen - Motore GT1",
"Allarme comunicazione CanOpen - Motore GT2",
"##",
"##",
"##"
]
},
{
"description": "Profinet Byte_01",
"tipoMem": "Byte",
"memAddr": "All_Byte_B1",
"index": 1,
"size": 1,
"messages": [
"Allarme comunicazione profinet - Modulo IOlink 1(TU) {A190.1}",
"Allarme comunicazione profinet - Modulo IOlink 2(TU) {A190.2}",
"Allarme comunicazione profinet - Modulo IOlink 3(TU) {A190.3}",
"Allarme comunicazione profinet - Modulo IOlink 1(LB) {A206.1}",
"Allarme comunicazione profinet - Modulo IOlink 2(LB) {A206.2}",
"Allarme comunicazione profinet - Modulo IOlink 3(LB) {A206.3}",
"Allarme comunicazione profinet - Modulo IOlink 6(LB) {A206.6}",
"Allarme comunicazione profinet - Modulo IOlink 1(UB) {A231.1}"
]
},
{
"description": "Profinet Byte_02",
"tipoMem": "Byte",
"memAddr": "All_Byte_B2",
"index": 2,
"size": 1,
"messages": [
"Allarme comunicazione profinet - Modulo IOlink 1.1(TU) {A690.1}",
"Allarme comunicazione profinet - Modulo IOlink 2.1(TU) {A690.2}",
"Allarme comunicazione profinet - Modulo IOlink 3.1(TU) {A690.3}",
"Allarme comunicazione profinet - Modulo IOlink 1.1(LB) {A706.1}",
"Allarme comunicazione profinet - Modulo IOlink 2.1(LB) {A706.2}",
"Allarme comunicazione profinet - Modulo IOlink 3.1(LB) {A706.3}",
"Allarme comunicazione profinet - Modulo IOlink 6.1(LB) {A706.6}",
"Allarme comunicazione profinet - Modulo IOlink 1.1(UB) {A731.1}"
]
},
{
"description": "Profinet Byte_03",
"tipoMem": "Byte",
"memAddr": "All_Byte_B3",
"index": 3,
"size": 1,
"messages": [
"Allarme comunicazione profinet - Encoder ruota 1 sinistra",
"Allarme comunicazione profinet - Encoder ruota 2 sinistra",
"Allarme comunicazione profinet - Encoder ruota 3 sinistra",
"Allarme comunicazione profinet - Encoder ruota 4 sinistra",
"Allarme comunicazione profinet - Encoder ruota 5 sinistra",
"Allarme comunicazione profinet - Encoder ruota 6 sinistra",
"Allarme comunicazione profinet - Encoder ruota 7 sinistra",
"Allarme comunicazione profinet - Encoder ruota 8 sinistra"
]
},
{
"description": "Profinet Byte_04",
"tipoMem": "Byte",
"memAddr": "All_Byte_B4",
"index": 4,
"size": 1,
"messages": [
"Allarme comunicazione profinet - Encoder ruota 1 destra",
"Allarme comunicazione profinet - Encoder ruota 2 destra",
"Allarme comunicazione profinet - Encoder ruota 3 destra",
"Allarme comunicazione profinet - Encoder ruota 4 destra",
"Allarme comunicazione profinet - Encoder ruota 5 destra",
"Allarme comunicazione profinet - Encoder ruota 6 destra",
"Allarme comunicazione profinet - Encoder ruota 7 destra",
"Allarme comunicazione profinet - Encoder ruota 8 destra"
]
},
{
"description": "Profinet Byte_05",
"tipoMem": "Byte",
"memAddr": "All_Byte_B5",
"index": 5,
"size": 1,
"messages": [
"Allarme comunicazione profinet - encoder carrello 1",
"Allarme comunicazione profinet - encoder carrello 2",
"Allarme comunicazione profinet - encoder carrello 3",
"Allarme comunicazione profinet - encoder carrello 4",
"Allarme comunicazione profinet - encoder carrello 5",
"Allarme comunicazione profinet - encoder carrello 6",
"Allarme comunicazione profinet - encoder carrello 7",
"Allarme comunicazione profinet - encoder carrello 8"
]
},
{
"description": "Profinet Byte_06",
"tipoMem": "Byte",
"memAddr": "All_Byte_B6",
"index": 6,
"size": 1,
"messages": [
"Allarme comunicazione profinet - encoder argano 1",
"Allarme comunicazione profinet - encoder argano 2",
"Allarme comunicazione profinet - encoder argano 3",
"Allarme comunicazione profinet - encoder argano 4",
"Allarme comunicazione profinet - encoder argano 5",
"Allarme comunicazione profinet - encoder argano 6",
"Allarme comunicazione profinet - encoder argano 7",
"Allarme comunicazione profinet - encoder argano 8"
]
},
{
"description": "Message Byte_07",
"tipoMem": "Byte",
"memAddr": "All_Byte_B7",
"index": 7,
"size": 1,
"messages": [
"Pulsante emergenza premuto su ruota 1 SX",
"Pulsante emergenza premuto su ruota 2 SX",
"Pulsante emergenza premuto su ruota 3 SX",
"Pulsante emergenza premuto su ruota 4 SX",
"Pulsante emergenza premuto su ruota 5 SX",
"Pulsante emergenza premuto su ruota 6 SX",
"Pulsante emergenza premuto su ruota 7 SX",
"Pulsante emergenza premuto su ruota 8 SX"
]
},
{
"description": "Message Byte_08",
"tipoMem": "Byte",
"memAddr": "All_Byte_B8",
"index": 8,
"size": 1,
"messages": [
"Pulsante emergenza premuto su ruota 1 DX",
"Pulsante emergenza premuto su ruota 2 DX",
"Pulsante emergenza premuto su ruota 3 DX",
"Pulsante emergenza premuto su ruota 4 DX",
"Pulsante emergenza premuto su ruota 5 DX",
"Pulsante emergenza premuto su ruota 6 DX",
"Pulsante emergenza premuto su ruota 7 DX",
"Pulsante emergenza premuto su ruota 8 DX"
]
},
{
"description": "Message Byte_09",
"tipoMem": "Byte",
"memAddr": "All_Byte_B9",
"index": 9,
"size": 1,
"messages": [
"Pulsante emergenza premuto su QE GT1",
"Pulsante emergenza premuto su QE GT2",
"Radiocomando spento o fungo di emergenza premuto",
"##",
"##",
"##",
"##",
"##"
]
},
{
"description": "Message Byte_10",
"tipoMem": "Byte",
"memAddr": "All_Byte_B10",
"index": 10,
"size": 1,
"messages": [
"Filtro Intasato 1 - GT1",
"Filtro Intasato 2 - GT1",
"Filtro Intasato 3 - GT1",
"Filtro Intasato 4 - GT1",
"Filtro Intasato 5 - GT1",
"Filtro Intasato 6 - GT1",
"Massima temperatura olio - GT1",
"Livello minimo olio - GT1"
]
},
{
"description": "Hydraulic Byte_11",
"tipoMem": "Byte",
"memAddr": "All_Byte_B11",
"index": 11,
"size": 1,
"messages": [
"Massima pressione sterzo - GT1",
"Allarme sensori di pressione su ralle",
"GT1 - Sensore livello olio - Massimo livello, Stop movimenti",
"##",
"Allarme Riserva diesel motore GT1",
"Anomalia motore diesel GT1",
"Timeout disattivazione frizione - inserimento pompe su GT1",
"##"
]
},
{
"description": "Hydraulic Byte_12",
"tipoMem": "Byte",
"memAddr": "All_Byte_B12",
"index": 12,
"size": 1,
"messages": [
"GT1 - Sensore livello olio - Nessun segnale",
"GT1 - Sensore pressione freno - Nessun segnale",
"GT1 - Sensore pressione traslazione - Nessun segnale",
"GT1 - Sensore pressione PVG1 - Nessun segnale",
"GT1 - Sensore pressione PVG2 - Nessun segnale",
"GT1 - Sensore pressione PVG3 - Nessun segnale",
"GT1 - Sensore pressione PVG4 - Nessun segnale",
"GT1 - Sensore pressione PVG5 - Nessun segnale"
]
},
{
"description": "Hydraulic Byte_13",
"tipoMem": "Byte",
"memAddr": "All_Byte_B13",
"index": 13,
"size": 1,
"messages": [
"##",
"##",
"##",
"##",
"##",
"GT1 - Sensore pressione pompa 2 - Nessun segnale",
"GT1 - Sensore pressione pompa 3 - Nessun segnale",
"GT1 - Sensore pressione pompa 4 - Nessun segnale"
]
},
{
"description": "Hydraulic Byte_14",
"tipoMem": "Byte",
"memAddr": "All_Byte_B14",
"index": 14,
"size": 1,
"messages": [
"GT1 - Sensore pressione pompa 5 - Nessun segnale",
"##",
"##",
"##",
"##",
"##",
"##",
"##"
]
},
{
"description": "Message Byte_15",
"tipoMem": "Byte",
"memAddr": "All_Byte_B15",
"index": 15,
"size": 1,
"messages": [
"Filtro Intasato 1 - GT2",
"Filtro Intasato 2 - GT2",
"Filtro Intasato 3 - GT2",
"Filtro Intasato 4 - GT2",
"Filtro Intasato 5 - GT2",
"Filtro Intasato 6 - GT2",
"##",
"Livello minimo olio - GT2"
]
},
{
"description": "Hydraulic Byte_16",
"tipoMem": "Byte",
"memAddr": "All_Byte_B16",
"index": 16,
"size": 1,
"messages": [
"Massima pressione sterzo - GT2",
"##",
"GT2 - Sensore livello olio - Massimo livello, Stop movimenti",
"##",
"Riserva diesel motore GT2",
"Anomalia motore diesel GT2",
"Timeout disattivazione frizione - inserimento pompe su GT2",
"##"
]
},
{
"description": "Hydraulic Byte_17",
"tipoMem": "Byte",
"memAddr": "All_Byte_B17",
"index": 17,
"size": 1,
"messages": [
"GT2 - Sensore livello olio - Nessun segnale",
"GT2 - Sensore pressione freno - Nessun segnale",
"GT2 - Sensore pressione traslazione - Nessun segnale",
"GT2 - Sensore pressione PVG1 - Nessun segnale",
"GT2 - Sensore pressione PVG2 - Nessun segnale",
"GT2 - Sensore pressione PVG3 - Nessun segnale",
"GT2 - Sensore pressione PVG4 - Nessun segnale",
"GT2 - Sensore pressione PVG5 - Nessun segnale"
]
},
{
"description": "Hydraulic Byte_18",
"tipoMem": "Byte",
"memAddr": "All_Byte_B18",
"index": 18,
"size": 1,
"messages": [
"##",
"##",
"##",
"##",
"##",
"GT2 - Sensore pressione pompa 2 - Nessun segnale",
"GT2 - Sensore pressione pompa 3 - Nessun segnale",
"GT2 - Sensore pressione pompa 4 - Nessun segnale"
]
},
{
"description": "Hydraulic Byte_19",
"tipoMem": "Byte",
"memAddr": "All_Byte_B19",
"index": 19,
"size": 1,
"messages": [
"GT2 - Sensore pressione pompa 5 - Nessun segnale",
"##",
"##",
"##",
"##",
"##",
"##",
"##"
]
},
{
"description": "Positioning Byte_20",
"tipoMem": "Byte",
"memAddr": "All_Byte_B20",
"index": 20,
"size": 1,
"messages": [
"Ruota fuori finestra 1 SX",
"Ruota fuori finestra 2 SX",
"Ruota fuori finestra 3 SX",
"Ruota fuori finestra 4 SX",
"Ruota fuori finestra 5 SX",
"Ruota fuori finestra 6 SX",
"Ruota fuori finestra 7 SX",
"Ruota fuori finestra 8 SX"
]
},
{
"description": "Positioning Byte_21",
"tipoMem": "Byte",
"memAddr": "All_Byte_B21",
"index": 21,
"size": 1,
"messages": [
"Ruota fuori finestra 1 DX",
"Ruota fuori finestra 2 DX",
"Ruota fuori finestra 3 DX",
"Ruota fuori finestra 4 DX",
"Ruota fuori finestra 5 DX",
"Ruota fuori finestra 6 DX",
"Ruota fuori finestra 7 DX",
"Ruota fuori finestra 8 DX"
]
},
{
"description": "Positioning Byte_22",
"tipoMem": "Byte",
"memAddr": "All_Byte_B22",
"index": 22,
"size": 1,
"messages": [
"##",
"Allarme fuori finestra 5°",
"Allarme fuori finestra 10°",
"##",
"##",
"##",
"##",
"##"
]
},
{
"description": "Wind Byte_23",
"tipoMem": "Byte",
"memAddr": "All_Byte_B23",
"index": 23,
"size": 1,
"messages": [
"Allarme trasduttore velocità vento",
"Allarme anemometro soglia 1",
"Allarme anemometro soglia 2",
"Bypass inserito - Anemometro",
"##",
"##",
"##",
"##"
]
},
{
"description": "Positioning Byte_24",
"tipoMem": "Byte",
"memAddr": "All_Byte_B24",
"index": 24,
"size": 1,
"messages": [
"Posizione argano 1 fuori finestra",
"Posizione argano 2 fuori finestra",
"Posizione argano 3 fuori finestra",
"Posizione argano 4 fuori finestra",
"Posizione argano 5 fuori finestra",
"Posizione argano 6 fuori finestra",
"Posizione argano 7 fuori finestra",
"Posizione argano 8 fuori finestra"
]
},
{
"description": "Positioning Byte_25",
"tipoMem": "Byte",
"memAddr": "All_Byte_B25",
"index": 25,
"size": 1,
"messages": [
"Posizione Carrello 1 fuori finestra",
"Posizione Carrello 2 fuori finestra",
"Posizione Carrello 3 fuori finestra",
"Posizione Carrello 4 fuori finestra",
"Posizione Carrello 5 fuori finestra",
"Posizione Carrello 6 fuori finestra",
"Posizione Carrello 7 fuori finestra",
"Posizione Carrello 8 fuori finestra"
]
},
{
"description": "Bypass Byte_26",
"tipoMem": "Byte",
"memAddr": "All_Byte_B26",
"index": 26,
"size": 1,
"messages": [
"Bypass inserito - encoder posizione - Argano 1",
"Bypass inserito - encoder posizione - Argano 2",
"Bypass inserito - encoder posizione - Argano 3",
"Bypass inserito - encoder posizione - Argano 4",
"Bypass inserito - encoder posizione - Argano 5",
"Bypass inserito - encoder posizione - Argano 6",
"Bypass inserito - encoder posizione - Argano 7",
"Bypass inserito - encoder posizione - Argano 8"
]
},
{
"description": "Weighting Byte_27",
"tipoMem": "Byte",
"memAddr": "All_Byte_B27",
"index": 27,
"size": 1,
"messages": [
"Guasto celle canale 1",
"Guasto celle canale 2",
"Guasto celle canale 3",
"Guasto celle canale 4",
"Allarme sovraccarico argani 7-8",
"Allarme sovraccarico argani 5-6",
"Allarme sovraccarico argani 3-4",
"Allarme sovraccarico argani 1-2"
]
},
{
"description": "Weighting Byte_28",
"tipoMem": "Byte",
"memAddr": "All_Byte_B28",
"index": 28,
"size": 1,
"messages": [
"Allarme sovraccarico somma totale",
"Stop sollevamento da controllo baricentro",
"##",
"##",
"##",
"##",
"##",
"##"
]
},
{
"description": "## Byte_29",
"tipoMem": "Byte",
"memAddr": "All_Byte_B29",
"index": 29,
"size": 1,
"messages": [
"##",
"##",
"##",
"##",
"##",
"##",
"##",
"##"
]
},
{
"description": "Bypass Byte_30",
"tipoMem": "Byte",
"memAddr": "All_Byte_B30",
"index": 30,
"size": 1,
"messages": [
"Bypass inserito - sensore pressione - Ruota SX 1",
"Bypass inserito - sensore pressione - Ruota SX 2",
"Bypass inserito - sensore pressione - Ruota SX 3",
"Bypass inserito - sensore pressione - Ruota SX 4",
"Bypass inserito - sensore pressione - Ruota SX 5",
"Bypass inserito - sensore pressione - Ruota SX 6",
"Bypass inserito - sensore pressione - Ruota SX 7",
"Bypass inserito - sensore pressione - Ruota SX 8"
]
},
{
"description": "Bypass Byte_31",
"tipoMem": "Byte",
"memAddr": "All_Byte_B31",
"index": 31,
"size": 1,
"messages": [
"Bypass inserito - sensore pressione - Ruota DX 1",
"Bypass inserito - sensore pressione - Ruota DX 2",
"Bypass inserito - sensore pressione - Ruota DX 3",
"Bypass inserito - sensore pressione - Ruota DX 4",
"Bypass inserito - sensore pressione - Ruota DX 5",
"Bypass inserito - sensore pressione - Ruota DX 6",
"Bypass inserito - sensore pressione - Ruota DX 7",
"Bypass inserito - sensore pressione - Ruota DX 8"
]
},
{
"description": "Bypass Byte_32",
"tipoMem": "Byte",
"memAddr": "All_Byte_B32",
"index": 32,
"size": 1,
"messages": [
"Bypass inserito - sensore posizione - Carrello 1",
"Bypass inserito - sensore posizione - Carrello 2",
"Bypass inserito - sensore posizione - Carrello 3",
"Bypass inserito - sensore posizione - Carrello 4",
"Bypass inserito - sensore posizione - Carrello 5",
"Bypass inserito - sensore posizione - Carrello 6",
"Bypass inserito - sensore posizione - Carrello 7",
"Bypass inserito - sensore posizione - Carrello 8"
]
},
{
"description": "Bypass Byte_33",
"tipoMem": "Byte",
"memAddr": "All_Byte_B33",
"index": 33,
"size": 1,
"messages": [
"Bypass inserito - sensore posizione - Carrello 1",
"Bypass inserito - sensore posizione - Carrello 2",
"Bypass inserito - sensore posizione - Carrello 3",
"Bypass inserito - sensore posizione - Carrello 4",
"Bypass inserito - sensore posizione - Carrello 5",
"Bypass inserito - sensore posizione - Carrello 6",
"Bypass inserito - sensore posizione - Carrello 7",
"Bypass inserito - sensore posizione - Carrello 8"
]
},
{
"description": "Bypass Byte_34",
"tipoMem": "Byte",
"memAddr": "All_Byte_B34",
"index": 34,
"size": 1,
"messages": [
"Bypass inserito - finecorsa posizione - Argano 1",
"Bypass inserito - finecorsa posizione - Argano 2",
"Bypass inserito - finecorsa posizione - Argano 3",
"Bypass inserito - finecorsa posizione - Argano 4",
"Bypass inserito - finecorsa posizione - Argano 5",
"Bypass inserito - finecorsa posizione - Argano 6",
"Bypass inserito - finecorsa posizione - Argano 7",
"Bypass inserito - finecorsa posizione - Argano 8"
]
},
{
"description": "Bypass Byte_35",
"tipoMem": "Byte",
"memAddr": "All_Byte_B35",
"index": 35,
"size": 1,
"messages": [
"Bypass inserito - controllo posizione baricentro",
"##",
"##",
"##",
"##",
"##",
"##",
"##"
]
},
{
"description": "## Byte_36",
"tipoMem": "Byte",
"memAddr": "All_Byte_B36",
"index": 36,
"size": 1,
"messages": [
"##",
"##",
"##",
"##",
"##",
"##",
"##",
"##"
]
},
{
"description": "Maintenance Byte_37",
"tipoMem": "Byte",
"memAddr": "All_Byte_B37",
"index": 37,
"size": 1,
"messages": [
"Richiesta manutenzione traslazione",
"Richiesta manutenzione sterzatura",
"Richiesta manutenzione motore GT1",
"Richiesta manutenzione motore GT2",
"Richiesta manutenzione argani",
"Richiesta manutenzione carrelli",
"##",
"##"
]
},
{
"description": "n/a Byte_B38",
"tipoMem": "Byte",
"memAddr": "n/a",
"index": 38,
"size": 1,
"messages": [
"n/a",
"n/a",
"n/a",
"n/a",
"n/a",
"n/a",
"n/a"
]
}
]
+2 -2
View File
@@ -48,8 +48,8 @@ BLINK_FILT=0
;BLINK_FILT=28
[OPTPAR]
;PZCOUNT_MODE=STD.[PAR/MEM].info|BIT.indice
PZCOUNT_MODE=STD.41100.UDINT32
;PZCOUNT_MODE=STD.Nome valore DynData
PZCOUNT_MODE=STD.NumPacchi
DISABLE_PZCOUNT=TRUE
ENABLE_SEND_PZC_BLOCK=TRUE
MIN_SEND_PZC_BLOCK=0
+4 -3
View File
@@ -32,7 +32,7 @@ SIZE_WRITE=0
[BLINK]
;MAX_COUNTER_BLINK = 30
MAX_COUNTER_BLINK = 15
MAX_COUNTER_BLINK = 1
;bit0 = 0
;bit1 = 0
;bit2 = 1
@@ -41,8 +41,8 @@ MAX_COUNTER_BLINK = 15
;bit5 = 0
;bit6 = 0
;bit7 = 0
BLINK_FILT=0
;BLINK_FILT=28
BLINK_FILT=131
[OPTPAR]
AUTO_CHANGE_ODL=false
@@ -53,11 +53,12 @@ PZCOUNT_MODE=OPC
DISABLE_PZCOUNT=FALSE
ENABLE_SEND_PZC_BLOCK=TRUE
MIN_SEND_PZC_BLOCK=0
MAX_SEND_PZC_BLOCK=100
MAX_SEND_PZC_BLOCK=10000
ENABLE_DYN_DATA=FALSE
FORCE_DYN_DATA=TRUE
ENABLE_DATA_FILTER=TRUE
ENABLE_CLI_RESTART=TRUE
MAX_TRY_PING=3
; conf parametri memoria READ/WRITE
OPC_PARAM_CONF=FINASSI_OMP_01.json
+2 -1
View File
@@ -54,7 +54,8 @@
},
"condWarmUpCoolDown": {
"checkMode": "OR",
"checkList": []
"checkList": [],
"negateValue": true
},
"condWarning": {
"checkMode": "AND",
+3 -2
View File
@@ -39,7 +39,8 @@ CLI_INST=SteamWareSim
;STARTLIST=GIACO_CENTERFRIGO
;STARTLIST=GIACO_NWSE
;STARTLIST=SIM_DP_01
;STARTLIST=FINASSI_HELPI_01
STARTLIST=FINASSI_OMP_01
STARTLIST=FINASSI_HELPI_01
;STARTLIST=FINASSI_OMP_01
;STARTLIST=BAGLIETTO_CIMOLAI_01
MAXCNC=10
+1 -6
View File
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace IOB_WIN_NEXT
namespace IOB_WIN_NEXT
{
public enum StartMode
{
+15 -3
View File
@@ -131,8 +131,8 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>ExtLib\krcc.dll</HintPath>
</Reference>
<Reference Include="MapoSDK, Version=6.14.2207.2913, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MapoSDK.6.14.2207.2913\lib\MapoSDK.dll</HintPath>
<Reference Include="MapoSDK, Version=6.14.2209.916, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MapoSDK.6.14.2209.916\lib\MapoSDK.dll</HintPath>
</Reference>
<Reference Include="MathNet.Numerics, Version=4.15.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MathNet.Numerics.4.15.0\lib\net461\MathNet.Numerics.dll</HintPath>
@@ -229,6 +229,8 @@
<Compile Include="IobModbusTCPCenterfrigo.cs" />
<Compile Include="IobModbusTCPHelpi.cs" />
<Compile Include="IobModbusTCPCedax.cs" />
<Compile Include="IobOpcUaMBH.cs" />
<Compile Include="IobOpcUaMBHCimolai.cs" />
<Compile Include="IobOpcUaSiemensOMP.cs" />
<Compile Include="IobOpcUaSiemens.cs" />
<Compile Include="IobOpcUaOmronIcoel.cs" />
@@ -306,6 +308,12 @@
<None Include="DATA\CONF\1033.ini">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\BAGLIETTO_CIMOLAI_01.ini">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\BAGLIETTO_CIMOLAI_01.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\GIACO_CEDAX_001.ini">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
@@ -342,6 +350,9 @@
<None Include="DATA\CONF\GIACO_CEDAX_003_MBlock.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\BAGLIETTO_CIMOLAI_01_alarm.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\GIACO_CENTERFRIGO_MBlock.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
@@ -416,7 +427,7 @@
<None Include="DATA\CONF\GT594.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\IobOpcUaClient.Config.xml">
<None Include="DATA\IobOpcUaClient.Config.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<Content Include="ExtLib\krcc.dll">
@@ -430,6 +441,7 @@
<Content Include="Readme\InterfacciaSiemensFape.txt" />
<Content Include="Readme\InterfacciaSiemensTorri.txt" />
<Content Include="Readme\ToDo.txt" />
<Content Include="RemoteDebugInfo.txt" />
<Content Include="Resources\ChangeLog.html">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
+23 -30
View File
@@ -1,30 +1,10 @@
using IOB_UT_NEXT;
using MapoSDK;
using Newtonsoft.Json;
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace IOB_WIN_NEXT
{
public class IobBeckhoff : IobGeneric
{
#region Protected Fields
protected TcAdsClient AdsCli;
/// <summary>
/// Veto controllo status x log...
/// </summary>
protected DateTime vetoCheckStatus = DateTime.Now;
#endregion Protected Fields
#region Public Fields
public List<string> dataVal = new List<string>();
@@ -54,15 +34,6 @@ namespace IOB_WIN_NEXT
#endregion Public Constructors
#region Protected Methods
protected void AdsCli_ValueChanged(TcAdsClient sender, string key, string value)
{
lg.Info($"Monitored Value changed | sender: {sender} | key: {key} | value: {value}");
}
#endregion Protected Methods
#region Public Methods
/// <summary>
@@ -125,6 +96,8 @@ namespace IOB_WIN_NEXT
}
}
/// <summary>
/// Override connessione
/// </summary>
public override void tryConnect()
@@ -168,5 +141,25 @@ namespace IOB_WIN_NEXT
}
#endregion Public Methods
#region Protected Fields
protected TcAdsClient AdsCli;
/// <summary>
/// Veto controllo status x log...
/// </summary>
protected DateTime vetoCheckStatus = DateTime.Now;
#endregion Protected Fields
#region Protected Methods
protected void AdsCli_ValueChanged(TcAdsClient sender, string key, string value)
{
lg.Info($"Monitored Value changed | sender: {sender} | key: {key} | value: {value}");
}
#endregion Protected Methods
}
}
+34 -40
View File
@@ -2,34 +2,14 @@
using MapoSDK;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading.Tasks;
namespace IOB_WIN_NEXT
{
public class IobBeckhoffCpa : IobBeckhoff
{
#region Private Fields
private string counterVar = "VarADS.BuoniLancio";
private string setArtVar = "VarADS.NomeDisegnoRichiesto";
private string setCommVar = "VarADS.NomeLancioRichiesto";
private string setParamsVar = "VarADS.bCambioArticolo";
private string setPzReqVar = "VarADS.nQuantitaRichiesta";
private string statusVar = "VarADS.StatoMacchina";
#endregion Private Fields
#region Protected Fields
protected int currStatus = 0;
#endregion Protected Fields
#region Public Constructors
/// <summary>
/// Estende l'init della classe base
/// <param name="caller"></param>
@@ -48,15 +28,12 @@ namespace IOB_WIN_NEXT
counterVar = getOptPar("CPA_PZCOUNT");
}
if (getOptPar("ADD_VARS").ToLower() == "true")
{
// fixme conf var gestite ad eventi da json
dataVal.Add(statusVar);
}
if (getOptPar("EARLY_CONNECT").ToLower() == "true")
{
tryConnect();
@@ -69,22 +46,6 @@ namespace IOB_WIN_NEXT
#endregion Public Constructors
#region Protected Methods
protected void AdsCli_CountChanged(TcAdsClient sender, int newCount)
{
contapezziPLC = newCount;
lg.Info($"Nuova lettura contapezzi | contapezziPLC: {contapezziPLC} | contapezziIOB: {contapezziIOB}");
}
protected void AdsCli_StatusChanged(TcAdsClient sender, int newStatus)
{
currStatus = newStatus;
lg.Info($"Status changed: {newStatus}");
}
#endregion Protected Methods
#region Public Methods
/// <summary>
@@ -304,6 +265,39 @@ namespace IOB_WIN_NEXT
#endregion Public Methods
#region Protected Fields
protected int currStatus = 0;
#endregion Protected Fields
#region Protected Methods
protected void AdsCli_CountChanged(TcAdsClient sender, int newCount)
{
contapezziPLC = newCount;
lg.Info($"Nuova lettura contapezzi | contapezziPLC: {contapezziPLC} | contapezziIOB: {contapezziIOB}");
}
protected void AdsCli_StatusChanged(TcAdsClient sender, int newStatus)
{
currStatus = newStatus;
lg.Info($"Status changed: {newStatus}");
}
#endregion Protected Methods
#region Private Fields
private string counterVar = "VarADS.BuoniLancio";
private string setArtVar = "VarADS.NomeDisegnoRichiesto";
private string setCommVar = "VarADS.NomeLancioRichiesto";
private string setParamsVar = "VarADS.bCambioArticolo";
private string setPzReqVar = "VarADS.nQuantitaRichiesta";
private string statusVar = "VarADS.StatoMacchina";
#endregion Private Fields
#if false
public enum EnuStates //Stato Macchina
{
+23 -22
View File
@@ -5,10 +5,8 @@ using System.Collections.Generic;
namespace IOB_WIN_NEXT
{
/// <summary>
/// This Configuration class is basically just a set of
/// properties with a couple of static methods to manage
/// the serialization to and deserialization from a
/// simple XML file.
/// This Configuration class is basically just a set of properties with a couple of static
/// methods to manage the serialization to and deserialization from a simple XML file.
///
/// ref: http://www.cambiaresearch.com/articles/33/how-can-i-easily-manage-an-xml-configuration-file-in-dotnet
/// </summary>
@@ -63,6 +61,11 @@ namespace IOB_WIN_NEXT
/// </summary>
public int MAX_COUNTER_BLINK { get; set; } = 10;
/// <summary>
/// Minimo delta in sec x considerare variazioni info
/// </summary>
public int minDeltaSec { get; set; } = 2;
/// <summary>
/// Modello della macchina
/// </summary>
@@ -86,7 +89,7 @@ namespace IOB_WIN_NEXT
/// <summary>
/// Dati di conf del server MoonPro cui comunicare
/// </summary>
public serverMapo serverData { get; set; } = new serverMapo("127.0.0.1", "/", "/IOB/input/", "/IOB/flog/", "/IOB/ulog/", "/IOB", "/IOB/enabled/", "/sendReboot.aspx?idxMacchina=", "/IOB/getCurrOdlStart/","SteamWare","/IOB/forceSplitOdlFull", "/IOB/getIdlePeriod", "/IOB/rawTransfJson");
public serverMapo serverData { get; set; } = new serverMapo("127.0.0.1", "/", "/IOB/input/", "/IOB/flog/", "/IOB/ulog/", "/IOB", "/IOB/enabled/", "/sendReboot.aspx?idxMacchina=", "/IOB/getCurrOdlStart/", "SteamWare", "/IOB/forceSplitOdlFull", "/IOB/getIdlePeriod", "/IOB/rawTransfJson");
/// <summary>
/// Slot (Siemens S7)
@@ -123,11 +126,6 @@ namespace IOB_WIN_NEXT
/// </summary>
public string versIOB { get; set; } = "0";
/// <summary>
/// Minimo delta in sec x considerare variazioni info
/// </summary>
public int minDeltaSec { get; set; } = 2;
#endregion Public Properties
}
@@ -241,30 +239,33 @@ namespace IOB_WIN_NEXT
public string CMDFLOG { get; set; } = "";
/// <summary>
/// comando base x LOG di FLUSSO generico - salvataggio parametri extra sistema MAPO in modalità JSON payload come lista
/// comando base x LOG di FLUSSO generico - salvataggio parametri extra sistema MAPO in
/// modalità JSON payload come lista
/// </summary>
public string CMDFLOG_JSON { get; set; } = "";
/// <summary>
/// comando base x Raw Transf LOG - salvataggio valori generici in modalità JSON payload
/// come lista
/// </summary>
public string CMDRAWTRANSF_JSON { get; set; } = "";
/// <summary>
/// comando base x comando reboot
/// </summary>
public string CMDREBO { get; set; } = "";
/// <summary>
/// comando base x USER LOG - salvataggio parametri extra sistema MAPO
/// </summary>
public string CMDULOG { get; set; } = "";
/// <summary>
/// comando base x Raw Transf LOG - salvataggio valori generici in modalità JSON payload come lista
/// </summary>
public string CMDRAWTRANSF_JSON { get; set; } = "";
/// <summary>
/// comando base x USER LOG - salvataggio parametri extra sistema MAPO in modalità JSON payload come lista
/// comando base x USER LOG - salvataggio parametri extra sistema MAPO in modalità JSON
/// payload come lista
/// </summary>
public string CMDULOG_JSON { get; set; } = "";
/// <summary>
/// comando base x comando reboot
/// </summary>
public string CMDREBO { get; set; } = "";
/// <summary>
/// Indirizzo IP server
/// </summary>
+970 -961
View File
File diff suppressed because it is too large Load Diff
+109 -115
View File
@@ -1,16 +1,9 @@
using IOB_UT_NEXT;
using MapoSDK;
using Newtonsoft.Json;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Firefox;
using System;
using System.Collections.Generic;
using System.IO;
using System.Net.NetworkInformation;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace IOB_WIN_NEXT
{
@@ -24,25 +17,6 @@ namespace IOB_WIN_NEXT
*
* -------------------------------------------------------------------------------- */
#region Protected Fields
/// <summary>
/// Cartella di base per interscambio
/// </summary>
protected string BaseDir = @"C:\Steamware";
/// <summary>
/// Array di configurazione degli oggetti da cercare x decodifica e recupero info
/// </summary>
protected Dictionary<string, string> dataLocatorLUT;
/// <summary>
/// Vettore della frequenza di ogni status trovato... invio ogni 100 rilevazioni (modulo 100, resto == 1)
/// </summary>
protected Dictionary<string, int> freqUnknStatus = new Dictionary<string, int>();
#endregion Protected Fields
#region Public Constructors
/// <summary>
@@ -58,95 +32,6 @@ namespace IOB_WIN_NEXT
#endregion Public Constructors
#region Private Methods
/// <summary>
/// Processo stati unknown...
/// </summary>
/// <param name="cKey"></param>
private void processUnknStatus(string cKey)
{
// cerco se avevo già una key nella dictionary...
if (freqUnknStatus.ContainsKey(cKey))
{
freqUnknStatus[cKey]++;
// se è 1 ogni 100 (%100, resto ==1) --> loggo...
if (freqUnknStatus[cKey] % 100 == 1)
{
lgInfo($"Errore in decodifica status: MAPPING non trovato per {cKey} | freq: {freqUnknStatus[cKey]}");
// accodo come invio di tipo FLOG...
string sVal = string.Format("[UnknStatus] {0}, freq: {1}", cKey, freqUnknStatus);
// chiamo accodamento...
accodaFLog(sVal, qEncodeFLog("UnknStatus", sVal));
}
}
else
{
// creo chiave con freq = 1
freqUnknStatus.Add(cKey, 1);
// log iniziale
lgInfo($"Errore in decodifica status: MAPPING non trovato per {cKey}");
}
}
#endregion Private Methods
#region Internal Methods
/// <summary>
/// Pulizia preliminare folder comunicazione
/// </summary>
internal virtual void cleanupFolder()
{
//
}
/// <summary>
/// Ricarica conf adapter...
/// </summary>
internal virtual void reloadAdapterConf()
{
#if false
// init obj display
newDisplayData currDispData = new newDisplayData();
lgInfo("BEGIN reloadAdapterConf");
// inizializzo LUT decodifica
string jsonConf = getOptPar("LUT_CONF");
if (!string.IsNullOrEmpty(jsonConf))
{
string jsonFullPath = $"{Application.StartupPath}/DATA/CONF/{jsonConf}";
lgInfo($"Apertura file {jsonFullPath}");
StreamReader reader = new StreamReader(jsonFullPath);
string jsonData = reader.ReadToEnd();
if (!string.IsNullOrEmpty(jsonData))
{
try
{
monitoredItems = JsonConvert.DeserializeObject<MonitoredItemsConf>(jsonData);
// salvo baseUri
baseDir = monitoredItems.SrvData.baseUri;
lgInfo($"baseUri = {baseDir}");
// imposto a zero la bitmap x riavvio!
B_input = 0;
// FORZO invio dati...
accodaSigIN(ref currDispData);
// loggo!
lgInfo($"init input bitmap to zero: {B_input}");
}
catch (Exception exc)
{
lgError(exc, "Eccezione in decodifica conf json");
}
}
reader.Dispose();
}
lgInfo("DONE reloadAdapterConf");
raiseRefresh(currDispData);
#endif
}
#endregion Internal Methods
#region Public Methods
public void Dispose()
@@ -358,5 +243,114 @@ namespace IOB_WIN_NEXT
}
#endregion Public Methods
#region Internal Methods
/// <summary>
/// Pulizia preliminare folder comunicazione
/// </summary>
internal virtual void cleanupFolder()
{
}
/// <summary>
/// Ricarica conf adapter...
/// </summary>
internal virtual void reloadAdapterConf()
{
#if false
// init obj display
newDisplayData currDispData = new newDisplayData();
lgInfo("BEGIN reloadAdapterConf");
// inizializzo LUT decodifica
string jsonConf = getOptPar("LUT_CONF");
if (!string.IsNullOrEmpty(jsonConf))
{
string jsonFullPath = $"{Application.StartupPath}/DATA/CONF/{jsonConf}";
lgInfo($"Apertura file {jsonFullPath}");
StreamReader reader = new StreamReader(jsonFullPath);
string jsonData = reader.ReadToEnd();
if (!string.IsNullOrEmpty(jsonData))
{
try
{
monitoredItems = JsonConvert.DeserializeObject<MonitoredItemsConf>(jsonData);
// salvo baseUri
baseDir = monitoredItems.SrvData.baseUri;
lgInfo($"baseUri = {baseDir}");
// imposto a zero la bitmap x riavvio!
B_input = 0;
// FORZO invio dati...
accodaSigIN(ref currDispData);
// loggo!
lgInfo($"init input bitmap to zero: {B_input}");
}
catch (Exception exc)
{
lgError(exc, "Eccezione in decodifica conf json");
}
}
reader.Dispose();
}
lgInfo("DONE reloadAdapterConf");
raiseRefresh(currDispData);
#endif
}
#endregion Internal Methods
#region Protected Fields
/// <summary>
/// Cartella di base per interscambio
/// </summary>
protected string BaseDir = @"C:\Steamware";
/// <summary>
/// Array di configurazione degli oggetti da cercare x decodifica e recupero info
/// </summary>
protected Dictionary<string, string> dataLocatorLUT;
/// <summary>
/// Vettore della frequenza di ogni status trovato... invio ogni 100 rilevazioni (modulo
/// 100, resto == 1)
/// </summary>
protected Dictionary<string, int> freqUnknStatus = new Dictionary<string, int>();
#endregion Protected Fields
#region Private Methods
/// <summary>
/// Processo stati unknown...
/// </summary>
/// <param name="cKey"></param>
private void processUnknStatus(string cKey)
{
// cerco se avevo già una key nella dictionary...
if (freqUnknStatus.ContainsKey(cKey))
{
freqUnknStatus[cKey]++;
// se è 1 ogni 100 (%100, resto ==1) --> loggo...
if (freqUnknStatus[cKey] % 100 == 1)
{
lgInfo($"Errore in decodifica status: MAPPING non trovato per {cKey} | freq: {freqUnknStatus[cKey]}");
// accodo come invio di tipo FLOG...
string sVal = string.Format("[UnknStatus] {0}, freq: {1}", cKey, freqUnknStatus);
// chiamo accodamento...
accodaFLog(sVal, qEncodeFLog("UnknStatus", sVal));
}
}
else
{
// creo chiave con freq = 1
freqUnknStatus.Add(cKey, 1);
// log iniziale
lgInfo($"Errore in decodifica status: MAPPING non trovato per {cKey}");
}
}
#endregion Private Methods
}
}
File diff suppressed because it is too large Load Diff
+244 -32
View File
@@ -1727,6 +1727,38 @@ namespace IOB_WIN_NEXT
return fatto;
}
/// <summary>
/// Processing degli allarmi (se presenti e gestiti)
/// </summary>
/// <returns></returns>
public virtual Dictionary<string, string> getAlarmData()
{
Dictionary<string, string> outVal = new Dictionary<string, string>();
// ora aggiungo (se ci fossero) gli allarmi...
if (alarmMaps != null && alarmMaps.Count > 0)
{
if (hasAlarms())
{
string bankVal = "";
foreach (var item in alarmMaps)
{
bankVal = "";
var currState = currAlarmsState(item);
// calcolo vettore stringa degli allarmi...
bankVal = getAlarmState(item, currState);
bankVal = string.IsNullOrEmpty(bankVal) ? "OK" : bankVal;
saveAlarmString(ref outVal, bankVal, item.description);
}
}
}
if (periodicLog || outVal.Count > 0)
{
lgDebug($"Esito getAlarmData: {outVal.Count} allarmi attivi/validi in outVal");
}
return outVal;
}
/// <summary>
/// Effettua conversione da valore bitmap ai valori configurati x allarme
/// </summary>
@@ -2568,6 +2600,19 @@ namespace IOB_WIN_NEXT
if (connectionOk)
{
currDynData = getDynData();
var currAlarmData = getAlarmData();
// se ho allarmi
if (currAlarmData != null && currAlarmData.Count > 0)
{
foreach (var item in currAlarmData)
{
if (!currDynData.ContainsKey(item.Key))
{
// aggiungo!
currDynData.Add(item.Key, item.Value);
}
}
}
try
{
string sVal = "";
@@ -2980,6 +3025,36 @@ namespace IOB_WIN_NEXT
return false;
}
/// <summary>
/// Effettua salvataggio in LUT del valore ricevuto (valori string)
/// - non serve calcolo medie o altro
/// - accoda in out val e basta
/// </summary>
/// <param name="outVal">Array eventi da popolare</param>
/// <param name="valore">valore da salvare</param>
/// <param name="chiave">ID/chiave di riferimento</param>
/// <returns></returns>
public virtual void saveAlarmString(ref Dictionary<string, string> outVal, string valore, string chiave)
{
DateTime adesso = DateTime.Now;
//check obj preliminare
if (outVal == null)
{
outVal = new Dictionary<string, string>();
}
// default invio: blindato a 120 sec (rivedere da conf?)
int vetoSendAlarms = 120;
// verifico se sia scaduto OVVERO variato rispetto a prima oppure oltre tempo
bool scaduto = !LastTSSSend.ContainsKey(chiave) || (LastTSSSend[chiave].AddSeconds(vetoSendAlarms) < adesso);
bool cambiato = !LastTSS.ContainsKey(chiave) || !LastTSS[chiave].Equals(valore);
if (scaduto || cambiato)
{
outVal.Add(chiave, valore);
LastTSS[chiave] = valore;
LastTSSSend[chiave] = adesso;
}
}
/// <summary>
/// metodo dummy x salvataggio aree memoria conf x CN
/// </summary>
@@ -3031,36 +3106,6 @@ namespace IOB_WIN_NEXT
LastTSVC[chiave] = valore;
}
/// <summary>
/// Effettua salvataggio in LUT del valore ricevuto (valori string)
/// - non serve calcolo medie o altro
/// - accoda in out val e basta
/// </summary>
/// <param name="outVal">Array eventi da popolare</param>
/// <param name="valore">valore da salvare</param>
/// <param name="chiave">ID/chiave di riferimento</param>
/// <returns></returns>
public virtual void saveAlarmString(ref Dictionary<string, string> outVal, string valore, string chiave)
{
DateTime adesso = DateTime.Now;
//check obj preliminare
if (outVal == null)
{
outVal = new Dictionary<string, string>();
}
// default invio: blindato a 120 sec (rivedere da conf?)
int vetoSendAlarms = 120;
// verifico se sia scaduto OVVERO variato rispetto a prima oppure oltre tempo
bool scaduto = !LastTSSSend.ContainsKey(chiave) || (LastTSSSend[chiave].AddSeconds(vetoSendAlarms) < adesso);
bool cambiato = !LastTSS.ContainsKey(chiave) || !LastTSS[chiave].Equals(valore);
if (scaduto || cambiato)
{
outVal.Add(chiave, valore);
LastTSS[chiave] = valore;
LastTSSSend[chiave] = adesso;
}
}
/// <summary>
/// Effettua salvataggio in LUT del valore ricevuto (valori string)
/// - non serve calcolo medie o altro
@@ -3826,6 +3871,21 @@ namespace IOB_WIN_NEXT
/// </summary>
protected int demFactDynData = 1;
/// <summary>
/// Boolean x indicare contapezzi disabilitato forzatamente da IOB
/// </summary>
protected bool disablePzCounteByIob = false;
/// <summary>
/// Boolean x indicare contapezzi abilitato a livello di conf apoplicazione
/// </summary>
protected bool enablePzCountByApp = true;
/// <summary>
/// Boolean x indicare contapezzi abilitato forzatamente da IOB
/// </summary>
protected bool enablePzCountByIob = true;
/// <summary>
/// Array dei contatori x segnali blinking
/// </summary>
@@ -3896,6 +3956,11 @@ namespace IOB_WIN_NEXT
/// </summary>
protected int maxSendErrors = utils.CRI("maxSendErrors");
/// <summary>
/// Numero massimo di tentativi x test ping preliminare
/// </summary>
protected int maxTryPing = 1;
/// <summary>
/// indica se serva refresh parametri e quindi PLC...
/// </summary>
@@ -4223,6 +4288,81 @@ namespace IOB_WIN_NEXT
return answ;
}
/// <summary>
/// Restituisce stato allarmi in formato byte[]
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
protected byte[] currAlarmsState(BaseAlarmConf item)
{
byte[] answ = new byte[item.size];
int currStatus = 0;
int[] listInt = new int[2];
// banchi in array Int16 --> scompongo
for (int i = 0; i < item.size / 2; i++)
{
#if false
// verifico se usare LUT
bool useLUT = memSetR != null && memSetR.Count > 0;
if (useLUT)
{
int lutAddress = 40000 + item.index;
if (HoldingRegisterLUT.ContainsKey(lutAddress))
{
try
{
listInt = HoldingRegisterLUT[lutAddress];
}
catch (Exception exc)
{
lgError($"Errore in lettura da HoldingRegisterLUT per indirizzo {lutAddress} | item {item.memAddr}{Environment.NewLine}{exc}");
}
}
}
else
{
listInt = readInputReg(item.index, item.size);
}
currStatus = ModbusClient.ConvertRegistersToInt(listInt);
#endif
currStatus = getAlarmStatus(item);
// aggiornamento blink counters dato nuovo valore
item.checkBlinkCounter(i, (uint)currStatus);
// calcolo indice errori
if ((uint)(item.alarmsMask[i] & currStatus) > 0)
{
var currByte = BitConverter.GetBytes(currStatus);
// salvo nell'array di byte
Buffer.BlockCopy(currByte, 0, answ, i * 2, 2);
}
}
return answ;
}
/// <summary>
/// Implementazione di riferimento della verifica stato allarmi
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
protected virtual int getAlarmStatus(BaseAlarmConf item)
{
int answ = 0;
return answ;
}
/// <summary>
/// Implementazione di riferimento della verifica stato allarmi formato UInt
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
protected virtual uint getAlarmStatusUInt(BaseAlarmConf item)
{
uint answ = 0;
return answ;
}
/// <summary>
/// Stringa raw dei parametri da scrivere...
/// </summary>
@@ -4267,6 +4407,78 @@ namespace IOB_WIN_NEXT
return answ;
}
/// <summary>
/// Verifica presenza eventuali allarmi
/// </summary>
/// <returns></returns>
protected virtual bool hasAlarms()
{
bool answ = false;
int numErrors = 0;
int currStatus = 0;
int[] listInt = new int[2];
if (alarmMaps != null)
{
// leggo a ciclo le aree degli allarmi CONFIGURATI, se ne trovo --> segnalo allarme...
foreach (var item in alarmMaps)
{
// banchi in array Int16 --> scompongo
for (int i = 0; i < item.size / 2; i++)
{
#if false
// verifico se usare LUT
bool useLUT = memSetR != null && memSetR.Count > 0;
if (useLUT)
{
int lutAddress = 40000 + item.index;
if (HoldingRegisterLUT.ContainsKey(lutAddress))
{
try
{
listInt = HoldingRegisterLUT[lutAddress];
}
catch (Exception exc)
{
lgError($"Errore in lettura da HoldingRegisterLUT per indirizzo {lutAddress} | item {item.memAddr}{Environment.NewLine}{exc}");
}
}
}
else
{
listInt = readInputReg(item.index, item.size);
}
currStatus = ModbusClient.ConvertRegistersToInt(listInt);
#endif
currStatus = getAlarmStatus(item);
// aggiornamento blink counters dato nuovo valore
item.checkBlinkCounter(i, (uint)currStatus);
// calcolo indice errori
if ((uint)(item.alarmsMask[i] & currStatus) > 0)
{
numErrors++;
}
// verifico SE sia variato... confronto allarmi filtrato stile blink per bit status:
// - allarmi che iniziano per # IGNORATI
// - altri allarmi con un countdown da MAX_COUNTER_BLINK a 0 per il fronte
// di discesa
if (item.isChanged(i, (uint)currStatus))
{
// registro gli allarmi attivi e trasmetto...
if (sendAlarmVariations(item.memAddr, i, item.alarmsState[i], (uint)(item.alarmsMask[i] & currStatus), item.messages))
{
// se inviato --> salvo stato da current...
item.updStatusVal(i, (uint)(item.alarmsMask[i] & currStatus));
}
}
}
}
}
answ = numErrors > 0;
return answ;
}
/// <summary>
/// Effettua logging DEBUG corretto impostanto anche la variabile IOB prima di scrivere...
/// </summary>
@@ -4617,6 +4829,7 @@ namespace IOB_WIN_NEXT
lgInfoStartup($"Apertura file {jsonFileName}");
StreamReader reader = new StreamReader(jsonFileName);
string jsonData = reader.ReadToEnd();
reader.Dispose();
if (!string.IsNullOrEmpty(jsonData))
{
lgInfoStartup($"File json ALLARMI composto da {jsonData.Length} caratteri");
@@ -4634,7 +4847,6 @@ namespace IOB_WIN_NEXT
{
lgError("Errore in loadMemConf: file json vuoto!");
}
reader.Dispose();
}
else
{
@@ -4865,7 +5077,7 @@ namespace IOB_WIN_NEXT
{
item.setupData();
// loggo
lgDebug($"Decodifica aree alarmMap: {item.description} | {item.memAddr} x {item.size} byte | {item.messages} messaggi allarme");
lgDebug($"Decodifica aree alarmMap: {item.description} | {item.memAddr} x {item.size} byte | {item.messages.Count} messaggi allarme");
}
// invio oggetto alarmMap al server x successiva decodifica
-2
View File
@@ -38,7 +38,6 @@ namespace IOB_WIN_NEXT
string SyncStatePwd = getOptPar("SyncStatePwd");
string SyncStateCTout = getOptPar("SyncStateCTout");
string connSyncState = $"data source={SyncStateDb};initial catalog=MoonPro_ISF;persist security info=True;user id={SyncStateUser};password={SyncStatePwd};MultipleActiveResultSets=True;App=IOB-WIN-NEXT";
// gestione command timeout da https://erikej.github.io/sqlclient/2020/10/26/sqlclient-commandtimeout-preview.html
@@ -47,7 +46,6 @@ namespace IOB_WIN_NEXT
connSyncState = $"{connSyncState};Command Timeout={SyncStateCTout}";
}
// eccezione: NON TROVA EntityFramework 6.0.0 o successivo... why?!?
dbProxy = new DbProxy(connSyncState);
+110 -110
View File
@@ -90,7 +90,6 @@ namespace IOB_WIN_NEXT
taskVal = executeSetSupplier(cmdArgs);
break;
case taskType.setParameter:
// richiedo da URL i parametri WRITE da popolare
lgInfo("Chiamata setParameter --> processMemWriteRequests");
@@ -129,114 +128,6 @@ namespace IOB_WIN_NEXT
return taskDone;
}
private string executeSetSupplier(string cmdArgs)
{
string taskVal;
// loggo i parametri ricevuti da popolare
lgInfo($"Chiamata setSupplier --> params payload: {cmdArgs}");
// recupero batch corrente x preselezionare i dati guid layout/varietà...
var currBatch = IcoelSizer.GetCurrentBatch();
// recupero GUID x variety e layout di default
var varGuid = currBatch[1].VarietyId;
var layGuid = currBatch[1].LayoutId;
// predispongo grower di default
GrowerInfo GrowerData = new GrowerInfo();
// le info sono una stringa separata da valore | di GrowerCode|GrowerName|varietyGuid|LayoutGuid;
string[] reqParams = cmdArgs.Split('|');
// se ho dati sistemo grower...
if (reqParams.Length >= 2)
{
//GrowerData.GrowerCode = reqParams[0];
//GrowerData.GrowerName = reqParams[1];
// sistemo commenti
var comments = new List<string>();
comments.Add($"sent {DateTime.Now: yyyy.MM.dd HH:mm:ss}");
comments.Add("Qty: no set");
comments.Add("------------");
//GrowerData.Comments = comments;
GrowerData = new GrowerInfo()
{
GrowerCode = reqParams[0],
GrowerName = reqParams[1],
Comments = comments
};
lgInfo($"Set grower data | GrowerCode: {GrowerData.GrowerCode} | GrowerName: {GrowerData.GrowerName}");
}
if (reqParams.Length >= 3)
{
Guid.TryParse(reqParams[2], out varGuid);
lgInfo($"Set Variety data | VarGUID: {varGuid}");
}
if (reqParams.Length >= 4)
{
Guid.TryParse(reqParams[3], out layGuid);
lgInfo($"Set Layout data | LayGUID: {layGuid}");
}
// invio richiesta!!!
IcoelSizer.EnqueueBatch(GrowerData, varGuid, layGuid);
lgInfo($"Request sent!");
taskVal = $"REQUEST SET SUPPLIER | EnqueueBatch | GrowCode: {GrowerData.GrowerCode} | GrowName: {GrowerData.GrowerName} | Var: {varGuid} | Lay: {layGuid} ";
// se restituiscce "" faccio altra prova...
if (string.IsNullOrEmpty(taskVal))
{
// i parametri me li aspetto come stringa composta paramName|paramvalue
if (cmdArgs.Contains("|"))
{
string[] paramsJob = cmdArgs.Split('|');
taskVal = $"REQUEST SET PARAMETERS: {paramsJob[0]} --> {paramsJob[1]}";
}
else
{
taskVal = $"WRONG REQUEST FOR SET PARAMETERS: {cmdArgs} doesnt contain pipe for splitting key/value";
}
}
return taskVal;
}
/// <summary>
/// Metodo da overridare x scrivere DAVVERO i parametri sul PLC
/// </summary>
/// <param name="updatedPar"></param>
protected override void plcWriteParams(ref List<objItem> updatedPar)
{
foreach (var item in updatedPar)
{
// cerco se sia setSupplier
if (item.uid == "setSupplier")
{
string reqVal = !string.IsNullOrEmpty(item.reqValue) ? item.reqValue : item.value;
// chiamo
var taskVal = executeSetSupplier(reqVal);
bool fatto = taskVal.StartsWith("REQUEST");
// se fatto --> aggiorno!
if (fatto)
{
//item.value = item.reqValue;
item.reqValue = "";
item.lastRead = DateTime.Now;
item.UM = "";
}
}
}
}
/// <summary>
/// Dizionario parametri correnti
/// </summary>
protected Dictionary<string, double> perfParamDict { get; set; } = new Dictionary<string, double>();
/// <summary>
/// Dizionario dati Batch correnti
/// </summary>
protected Dictionary<string, string> batchDataDict { get; set; } = new Dictionary<string, string>();
/// <summary>
/// Recupero dati dinamici...
/// </summary>
@@ -342,7 +233,7 @@ namespace IOB_WIN_NEXT
if (currBatchList[1].EndTime == DateTime.MinValue || currBatchList[1].EndTime == DateTime.MinValue)
{
B_input = 3;
}
}
#endif
}
// accodo NON emergenza
@@ -435,6 +326,11 @@ namespace IOB_WIN_NEXT
#region Protected Properties
/// <summary>
/// Dizionario dati Batch correnti
/// </summary>
protected Dictionary<string, string> batchDataDict { get; set; } = new Dictionary<string, string>();
/// <summary>
/// elenco dei BAtch correntemente caricati x testing variazione
/// </summary>
@@ -442,10 +338,42 @@ namespace IOB_WIN_NEXT
protected Connector IcoelSizer { get; set; }
/// <summary>
/// Dizionario parametri correnti
/// </summary>
protected Dictionary<string, double> perfParamDict { get; set; } = new Dictionary<string, double>();
#endregion Protected Properties
#region Protected Methods
/// <summary>
/// Metodo da overridare x scrivere DAVVERO i parametri sul PLC
/// </summary>
/// <param name="updatedPar"></param>
protected override void plcWriteParams(ref List<objItem> updatedPar)
{
foreach (var item in updatedPar)
{
// cerco se sia setSupplier
if (item.uid == "setSupplier")
{
string reqVal = !string.IsNullOrEmpty(item.reqValue) ? item.reqValue : item.value;
// chiamo
var taskVal = executeSetSupplier(reqVal);
bool fatto = taskVal.StartsWith("REQUEST");
// se fatto --> aggiorno!
if (fatto)
{
//item.value = item.reqValue;
item.reqValue = "";
item.lastRead = DateTime.Now;
item.UM = "";
}
}
}
}
/// <summary>
/// recupera le variety ed i rispettivi layout e li invia al sistema MP/IO
/// </summary>
@@ -465,5 +393,77 @@ namespace IOB_WIN_NEXT
}
#endregion Protected Methods
#region Private Methods
private string executeSetSupplier(string cmdArgs)
{
string taskVal;
// loggo i parametri ricevuti da popolare
lgInfo($"Chiamata setSupplier --> params payload: {cmdArgs}");
// recupero batch corrente x preselezionare i dati guid layout/varietà...
var currBatch = IcoelSizer.GetCurrentBatch();
// recupero GUID x variety e layout di default
var varGuid = currBatch[1].VarietyId;
var layGuid = currBatch[1].LayoutId;
// predispongo grower di default
GrowerInfo GrowerData = new GrowerInfo();
// le info sono una stringa separata da valore | di GrowerCode|GrowerName|varietyGuid|LayoutGuid;
string[] reqParams = cmdArgs.Split('|');
// se ho dati sistemo grower...
if (reqParams.Length >= 2)
{
//GrowerData.GrowerCode = reqParams[0];
//GrowerData.GrowerName = reqParams[1];
// sistemo commenti
var comments = new List<string>();
comments.Add($"sent {DateTime.Now: yyyy.MM.dd HH:mm:ss}");
comments.Add("Qty: no set");
comments.Add("------------");
//GrowerData.Comments = comments;
GrowerData = new GrowerInfo()
{
GrowerCode = reqParams[0],
GrowerName = reqParams[1],
Comments = comments
};
lgInfo($"Set grower data | GrowerCode: {GrowerData.GrowerCode} | GrowerName: {GrowerData.GrowerName}");
}
if (reqParams.Length >= 3)
{
Guid.TryParse(reqParams[2], out varGuid);
lgInfo($"Set Variety data | VarGUID: {varGuid}");
}
if (reqParams.Length >= 4)
{
Guid.TryParse(reqParams[3], out layGuid);
lgInfo($"Set Layout data | LayGUID: {layGuid}");
}
// invio richiesta!!!
IcoelSizer.EnqueueBatch(GrowerData, varGuid, layGuid);
lgInfo($"Request sent!");
taskVal = $"REQUEST SET SUPPLIER | EnqueueBatch | GrowCode: {GrowerData.GrowerCode} | GrowName: {GrowerData.GrowerName} | Var: {varGuid} | Lay: {layGuid} ";
// se restituiscce "" faccio altra prova...
if (string.IsNullOrEmpty(taskVal))
{
// i parametri me li aspetto come stringa composta paramName|paramvalue
if (cmdArgs.Contains("|"))
{
string[] paramsJob = cmdArgs.Split('|');
taskVal = $"REQUEST SET PARAMETERS: {paramsJob[0]} --> {paramsJob[1]}";
}
else
{
taskVal = $"WRONG REQUEST FOR SET PARAMETERS: {cmdArgs} doesnt contain pipe for splitting key/value";
}
}
return taskVal;
}
#endregion Private Methods
}
}
File diff suppressed because it is too large Load Diff
+635 -632
View File
File diff suppressed because it is too large Load Diff
+65 -143
View File
@@ -243,23 +243,6 @@ namespace IOB_WIN_NEXT
outVal = new Dictionary<string, string>();
tryConnect();
}
// ora aggiungo (se ci fossero) gli allarmi...
if (alarmMaps != null && alarmMaps.Count > 0)
{
if (hasAlarms)
{
string bankVal = "";
foreach (var item in alarmMaps)
{
bankVal = "";
var currState = currAlarmsState(item);
// calcolo vettore stringa degli allarmi...
bankVal = getAlarmState(item, currState);
bankVal = string.IsNullOrEmpty(bankVal) ? "OK" : bankVal;
saveAlarmString(ref outVal, bankVal, item.description);
}
}
}
}
}
else
@@ -599,75 +582,6 @@ namespace IOB_WIN_NEXT
#region Protected Properties
protected bool hasAlarms
{
get
{
bool answ = false;
int numErrors = 0;
int currStatus = 0;
int[] listInt = new int[2];
if (alarmMaps != null)
{
// leggo a ciclo le aree degli allarmi CONFIGURATI, se ne trovo --> segnalo allarme...
foreach (var item in alarmMaps)
{
// banchi in array Int16 --> scompongo
for (int i = 0; i < item.size / 2; i++)
{
// verifico se usare LUT
bool useLUT = memSetR != null && memSetR.Count > 0;
if (useLUT)
{
int lutAddress = 40000 + item.index;
if (HoldingRegisterLUT.ContainsKey(lutAddress))
{
try
{
listInt = HoldingRegisterLUT[lutAddress];
}
catch (Exception exc)
{
lgError($"Errore in lettura da HoldingRegisterLUT per indirizzo {lutAddress} | item {item.memAddr}{Environment.NewLine}{exc}");
}
}
}
else
{
listInt = readInputReg(item.index, item.size);
}
currStatus = ModbusClient.ConvertRegistersToInt(listInt);
// aggiornamento blink counters dato nuovo valore
item.checkBlinkCounter(i, (uint)currStatus);
// calcolo indice errori
if ((uint)(item.alarmsMask[i] & currStatus) > 0)
{
numErrors++;
}
// verifico SE sia variato... confronto allarmi filtrato stile blink per
// bit status:
// - allarmi che iniziano per # IGNORATI
// - altri allarmi con un countdown da MAX_COUNTER_BLINK a 0 per il
// fronte di discesa
if (item.isChanged(i, (uint)currStatus))
{
// registro gli allarmi attivi e trasmetto...
if (sendAlarmVariations(item.memAddr, i, item.alarmsState[i], (uint)(item.alarmsMask[i] & currStatus), item.messages))
{
// se inviato --> salvo stato da current...
item.updStatusVal(i, (uint)(item.alarmsMask[i] & currStatus));
}
}
}
}
}
answ = numErrors > 0;
return answ;
}
}
/// <summary>
/// Dizionario delle ultime operazioni di scrittura per OGNI memoria (in modo che fa log
/// ogni x sec...)
@@ -678,56 +592,6 @@ namespace IOB_WIN_NEXT
#region Protected Methods
/// <summary>
/// Restituisce stato allarmi in formato byte[]
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
protected byte[] currAlarmsState(BaseAlarmConf item)
{
byte[] answ = new byte[item.size];
int currStatus = 0;
int[] listInt = new int[2];
// banchi in array Int16 --> scompongo
for (int i = 0; i < item.size / 2; i++)
{
// verifico se usare LUT
bool useLUT = memSetR != null && memSetR.Count > 0;
if (useLUT)
{
int lutAddress = 40000 + item.index;
if (HoldingRegisterLUT.ContainsKey(lutAddress))
{
try
{
listInt = HoldingRegisterLUT[lutAddress];
}
catch (Exception exc)
{
lgError($"Errore in lettura da HoldingRegisterLUT per indirizzo {lutAddress} | item {item.memAddr}{Environment.NewLine}{exc}");
}
}
}
else
{
listInt = readInputReg(item.index, item.size);
}
currStatus = ModbusClient.ConvertRegistersToInt(listInt);
// aggiornamento blink counters dato nuovo valore
item.checkBlinkCounter(i, (uint)currStatus);
// calcolo indice errori
if ((uint)(item.alarmsMask[i] & currStatus) > 0)
{
var currByte = BitConverter.GetBytes(currStatus);
// salvo nell'array di byte
Buffer.BlockCopy(currByte, 0, answ, i * 2, 2);
}
}
return answ;
}
/// <summary>
/// Decodifica il resto dell'area x i dati accessori (allarmi, ...)
/// </summary>
@@ -745,6 +609,40 @@ namespace IOB_WIN_NEXT
B_input = 0;
}
/// <summary>
/// Recupero allarmi specifico x ModbusTCP
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
protected override int getAlarmStatus(BaseAlarmConf item)
{
int answ = 0;
int[] listInt = new int[2];
// verifico se usare LUT
bool useLUT = memSetR != null && memSetR.Count > 0;
if (useLUT)
{
int lutAddress = 40000 + item.index;
if (HoldingRegisterLUT.ContainsKey(lutAddress))
{
try
{
listInt = HoldingRegisterLUT[lutAddress];
}
catch (Exception exc)
{
lgError($"Errore in lettura da HoldingRegisterLUT per indirizzo {lutAddress} | item {item.memAddr}{Environment.NewLine}{exc}");
}
}
}
else
{
listInt = readInputReg(item.index, item.size);
}
answ = ModbusClient.ConvertRegistersToInt(listInt);
return answ;
}
/// <summary>
/// Override metodo x scrittura parametri su PLC
/// </summary>
@@ -801,7 +699,6 @@ namespace IOB_WIN_NEXT
fatto = writeInputReg(currMem.index, CurrVal, parametri.holdRegBaseAddr);
break;
case plcDataType.IntLH:
valInt = getScaledInt(currMem, true);
if (byteSize == 1)
@@ -896,6 +793,35 @@ namespace IOB_WIN_NEXT
}
}
public override void processContapezzi()
{
if ((enablePzCountByApp || enablePzCountByIob) && !(disablePzCounteByIob))
{
if (cIobConf.optPar.Count > 0 && !string.IsNullOrWhiteSpace(getOptPar("PZCOUNT_MODE")))
{
// cerco in lastDynData...
string pzCountKey = getOptPar("PZCOUNT_MODE").Replace("STD.", "");
if (lastDynData.ContainsKey(pzCountKey))
{
string rawVal = lastDynData[pzCountKey];
double cntDouble = -1;
if (!string.IsNullOrEmpty(rawVal))
{
double.TryParse(rawVal, out cntDouble);
if (cntDouble >= 0)
{
contapezziPLC = (int)cntDouble;
}
}
}
}
}
else
{
lgTrace($"processContapezzi escluso: enablePzCountByApp = {enablePzCountByApp} | enablePzCountByIob: {enablePzCountByIob} | disablePzCounteByIob: {disablePzCounteByIob}");
}
}
/// <summary>
/// Imposto parametri PLC
/// </summary>
@@ -1155,8 +1081,6 @@ namespace IOB_WIN_NEXT
#region Private Methods
/// <summary>
/// converte valore in tipo desiderato
/// </summary>
@@ -1241,7 +1165,6 @@ namespace IOB_WIN_NEXT
valore = ModbusClient.ConvertRegistersToInt(listInt);
}
break;
}
return valore;
}
@@ -1258,10 +1181,9 @@ namespace IOB_WIN_NEXT
return valDouble;
}
/// <summary>
/// Effettua scalatura valore secondo fattore
/// Read --> * (moltiplico)
/// Write --> / (divido)
/// Effettua scalatura valore secondo fattore Read --&gt; * (moltiplico) Write --&gt; / (divido)
/// </summary>
/// <param name="currMem"></param>
/// <param name="isWrite"></param>
+52 -60
View File
@@ -1,19 +1,11 @@
using EasyModbus;
using IOB_UT_NEXT;
using MapoSDK;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading.Tasks;
namespace IOB_WIN_NEXT
{
/* --------------------------------------------------------------------------------
* Controlli ModBusTCP Hunitronix Cedax
* - protocollo ModBus TCP
* - protocollo ModBus TCP
* - specifico comportamento impianti Unitronix Cedax
* - nessuna gestione allarmi
*
@@ -54,6 +46,57 @@ namespace IOB_WIN_NEXT
#endregion Public Constructors
#region Protected Methods
/// <summary>
/// Effettua decodifica aree memoria alla bitmap usata x MAPO
/// </summary>
protected override void decodeToBaseBitmap()
{
// init a zero...
B_input = 0;
/* -----------------------------------------------------
* bitmap MAPO STANDARD 60
* B0: POWER_ON
* B1: RUN
* B2: pzCount
* B3: allarme
* B4: manuale
* B5: slowTC
* B6: WarmUpCoolDown
* B7: EmergArmata
*
----------------------------------------------------- */
var MemInt = new byte[2];
int byteSignals = 0;
// bit 0 (poweron) imposto a 1 SE connected...
if (currPLC.Connected)
{
byteSignals += (1 << 0);
}
// processo dagli stati + gravi...
if (hasAlarms())
{
byteSignals += (1 << 3);
}
else
{
byteSignals += (1 << 1);
}
// segnalo NON emergenza
byteSignals += (1 << 7);
// salvo!
B_input = byteSignals;
}
#endregion Protected Methods
#region Private Methods
private void testBlockRead(int baseAddr, int numByte)
@@ -89,56 +132,5 @@ namespace IOB_WIN_NEXT
}
#endregion Private Methods
#region Protected Methods
/// <summary>
/// Effettua decodifica aree memoria alla bitmap usata x MAPO
/// </summary>
protected override void decodeToBaseBitmap()
{
// init a zero...
B_input = 0;
/* -----------------------------------------------------
* bitmap MAPO STANDARD 60
* B0: POWER_ON
* B1: RUN
* B2: pzCount
* B3: allarme
* B4: manuale
* B5: slowTC
* B6: WarmUpCoolDown
* B7: EmergArmata
*
----------------------------------------------------- */
var MemInt = new byte[2];
int byteSignals = 0;
// bit 0 (poweron) imposto a 1 SE connected...
if (currPLC.Connected)
{
byteSignals += (1 << 0);
}
// processo dagli stati + gravi...
if (hasAlarms)
{
byteSignals += (1 << 3);
}
else
{
byteSignals += (1 << 1);
}
// segnalo NON emergenza
byteSignals += (1 << 7);
// salvo!
B_input = byteSignals;
}
#endregion Protected Methods
}
}
+53 -61
View File
@@ -1,19 +1,11 @@
using EasyModbus;
using IOB_UT_NEXT;
using MapoSDK;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading.Tasks;
namespace IOB_WIN_NEXT
{
/* --------------------------------------------------------------------------------
* Controlli ModBusTCP Centerfrigo
* - protocollo ModBus TCP
* - protocollo ModBus TCP
* - specifico comportamento impianti Centerfrigo
* - gestione allarmi
* - gestione stati salvati come dynData
@@ -23,7 +15,7 @@ namespace IOB_WIN_NEXT
* lettura: xxx byte,
* scrittura yyy byte
* G:\Drive condivisi\30_Clienti\Giacovelli - WIL\CenterFrigo
*
*
* ATTENZIONE! leggere al max 44 byte alla volta
*
* -------------------------------------------------------------------------------- */
@@ -57,6 +49,57 @@ namespace IOB_WIN_NEXT
#endregion Public Constructors
#region Protected Methods
/// <summary>
/// Effettua decodifica aree memoria alla bitmap usata x MAPO
/// </summary>
protected override void decodeToBaseBitmap()
{
// init a zero...
B_input = 0;
/* -----------------------------------------------------
* bitmap MAPO STANDARD 60
* B0: POWER_ON
* B1: RUN
* B2: pzCount
* B3: allarme
* B4: manuale
* B5: slowTC
* B6: WarmUpCoolDown
* B7: EmergArmata
*
----------------------------------------------------- */
var MemInt = new byte[2];
int byteSignals = 0;
// bit 0 (poweron) imposto a 1 SE connected...
if (currPLC.Connected)
{
byteSignals += (1 << 0);
}
// processo dagli stati + gravi...
if (hasAlarms())
{
byteSignals += (1 << 3);
}
else
{
byteSignals += (1 << 1);
}
// segnalo NON emergenza
byteSignals += (1 << 7);
// salvo!
B_input = byteSignals;
}
#endregion Protected Methods
#region Private Methods
private void testBlockRead(int baseAddr, int numByte)
@@ -92,56 +135,5 @@ namespace IOB_WIN_NEXT
}
#endregion Private Methods
#region Protected Methods
/// <summary>
/// Effettua decodifica aree memoria alla bitmap usata x MAPO
/// </summary>
protected override void decodeToBaseBitmap()
{
// init a zero...
B_input = 0;
/* -----------------------------------------------------
* bitmap MAPO STANDARD 60
* B0: POWER_ON
* B1: RUN
* B2: pzCount
* B3: allarme
* B4: manuale
* B5: slowTC
* B6: WarmUpCoolDown
* B7: EmergArmata
*
----------------------------------------------------- */
var MemInt = new byte[2];
int byteSignals = 0;
// bit 0 (poweron) imposto a 1 SE connected...
if (currPLC.Connected)
{
byteSignals += (1 << 0);
}
// processo dagli stati + gravi...
if (hasAlarms)
{
byteSignals += (1 << 3);
}
else
{
byteSignals += (1 << 1);
}
// segnalo NON emergenza
byteSignals += (1 << 7);
// salvo!
B_input = byteSignals;
}
#endregion Protected Methods
}
}
+45 -53
View File
@@ -1,13 +1,5 @@
using EasyModbus;
using IOB_UT_NEXT;
using MapoSDK;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading.Tasks;
namespace IOB_WIN_NEXT
{
@@ -51,6 +43,51 @@ namespace IOB_WIN_NEXT
#endregion Public Constructors
#region Protected Methods
/// <summary>
/// Effettua decodifica aree memoria alla bitmap usata x MAPO/GWMS
/// - per lo scopo specifico IN REALTA' non conta lo stato macchina.... ma lo inviamo lo stesso
/// </summary>
protected override void decodeToBaseBitmap()
{
// init a zero...
B_input = 0;
/* -----------------------------------------------------
* bitmap MAPO STANDARD
* B0: POWER_ON
* B1: RUN
* B2: pzCount
* B3: allarme
*
----------------------------------------------------- */
var MemInt = new byte[2];
int byteSignals = 0;
// bit 0 (poweron) imposto a 1 SE connected...
if (currPLC.Connected)
{
byteSignals += (1 << 0);
}
// processo dagli stati + gravi...
if (hasAlarms())
{
byteSignals += (1 << 3);
}
else
{
byteSignals += (1 << 1);
}
// salvo!
B_input = byteSignals;
}
#endregion Protected Methods
#region Private Methods
private void testBlockRead(int baseAddr, int numByte)
@@ -93,50 +130,5 @@ namespace IOB_WIN_NEXT
}
#endregion Private Methods
#region Protected Methods
/// <summary>
/// Effettua decodifica aree memoria alla bitmap usata x MAPO/GWMS
/// - per lo scopo specifico IN REALTA' non conta lo stato macchina.... ma lo inviamo lo stesso
/// </summary>
protected override void decodeToBaseBitmap()
{
// init a zero...
B_input = 0;
/* -----------------------------------------------------
* bitmap MAPO STANDARD
* B0: POWER_ON
* B1: RUN
* B2: pzCount
* B3: allarme
*
----------------------------------------------------- */
var MemInt = new byte[2];
int byteSignals = 0;
// bit 0 (poweron) imposto a 1 SE connected...
if (currPLC.Connected)
{
byteSignals += (1 << 0);
}
// processo dagli stati + gravi...
if (hasAlarms)
{
byteSignals += (1 << 3);
}
else
{
byteSignals += (1 << 1);
}
// salvo!
B_input = byteSignals;
}
#endregion Protected Methods
}
}
+83 -86
View File
@@ -1,21 +1,13 @@
using EasyModbus;
using IOB_UT_NEXT;
using MapoSDK;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading.Tasks;
namespace IOB_WIN_NEXT
{
/* --------------------------------------------------------------------------------
* Controlli ModBusTCP Helpi
* - protocollo ModBus TCP
* - protocollo ModBus TCP
* - specifico comportamento impianti confezionatrici Helpi
*
*
* NRicetta UINT 16bit 41060 W
* ApplicaRicetta UINT 16bit 41061 R/W
* IDOrdine STRING [30] 41062 W
@@ -28,7 +20,7 @@ namespace IOB_WIN_NEXT
* EpochStop UDINT 32bit 41104 R
* PPM REAL 32bit 41106 R
* StatusLavoro UINT 16bit 41108 R
*
*
* StatusLavoro indica lo stato della macchina:
* 0. macchina completamente ferma
* 1. macchina in riscaldamento
@@ -44,7 +36,6 @@ namespace IOB_WIN_NEXT
{
#region Public Constructors
/// <summary>
/// Classe base con i metodi x ModBusTCP
/// </summary>
@@ -74,41 +65,53 @@ namespace IOB_WIN_NEXT
#endregion Public Constructors
#region Private Methods
#region Protected Properties
private void testBlockRead(int baseAddr, int numByte)
/// <summary>
/// Restituisce status di emergenza, hard coded dall'area di allarmi
/// </summary>
protected bool EStop
{
int baseHold = 41060;
int[] readTestFull = new int[50];
lgTrace($"-------------------- Inizio test lettura {baseAddr} --------------------");
try
get
{
stopwatch.Restart();
readTestFull = currPLC.ReadHoldingRegisters(baseAddr - baseHold, numByte);
stopwatch.Stop();
lgTrace($"Stats lettura | {readTestFull.Length} val | {stopwatch.ElapsedMilliseconds}ms");
}
catch
{ }
for (int i = 0; i < readTestFull.Length / 2; i++)
{
int[] thisSet = new int[2];
Array.Copy(readTestFull, i * 2, thisSet, 0, 2);
lgTrace($"{baseAddr + i * 2:000} | HoldingRegisters: {thisSet[0]} / {thisSet[1]} | Val Real: {ModbusClient.ConvertRegistersToFloat(thisSet):N6}");
}
lgTrace("-------------------- Completato test lettura {baseAddr} --------------------");
}
private void testRead()
{
foreach (var item in memSetR)
{
testBlockRead(item.Key, item.Value);
bool answ = false;
int currStatus = 0;
// hard coded
int statusReg = 41094;
// deve avere allarmi (è un allarme EStop)
if (hasAlarms())
{
int[] listInt = new int[2];
listInt = HoldingRegisterLUT[statusReg];
currStatus = ModbusClient.ConvertRegistersToInt(listInt);
// hard coded il 5° bit
answ = ((currStatus & (1 << 4)) > 0);
}
return answ;
}
}
#endregion Private Methods
/// <summary>
/// Restituisce status di lavorazione, hard coded dall'area di memoria 41108
/// </summary>
protected int StatusLavoro
{
get
{
int answ = 0;
// hard coded
int statusReg = 41108;
if (HoldingRegisterLUT.ContainsKey(statusReg))
{
int[] listInt = new int[2];
listInt = HoldingRegisterLUT[statusReg];
answ = ModbusClient.ConvertRegistersToInt(listInt);
}
return answ;
}
}
#endregion Protected Properties
#region Protected Methods
@@ -147,7 +150,7 @@ namespace IOB_WIN_NEXT
{
byteSignals += (1 << 7);
}
else if (hasAlarms)
else if (hasAlarms())
{
byteSignals += (1 << 3);
}
@@ -160,13 +163,16 @@ namespace IOB_WIN_NEXT
case 0:
default:
break;
case 1:
byteSignals += (1 << 6);
break;
case 2:
case 3:
byteSignals += (1 << 4);
break;
case 4:
byteSignals += (1 << 1);
break;
@@ -177,51 +183,42 @@ namespace IOB_WIN_NEXT
B_input = byteSignals;
}
/// <summary>
/// Restituisce status di lavorazione, hard coded dall'area di memoria 41108
/// </summary>
protected int StatusLavoro
{
get
{
int answ = 0;
// hard coded
int statusReg = 41108;
if (HoldingRegisterLUT.ContainsKey(statusReg))
{
int[] listInt = new int[2];
listInt = HoldingRegisterLUT[statusReg];
answ = ModbusClient.ConvertRegistersToInt(listInt);
}
return answ;
}
}
/// <summary>
/// Restituisce status di emergenza, hard coded dall'area di allarmi
/// </summary>
protected bool EStop
{
get
{
bool answ = false;
int currStatus = 0;
// hard coded
int statusReg = 41094;
// deve avere allarmi (è un allarme EStop)
if (hasAlarms)
{
int[] listInt = new int[2];
listInt = HoldingRegisterLUT[statusReg];
currStatus = ModbusClient.ConvertRegistersToInt(listInt);
// hard coded il 5° bit
answ = ((currStatus & (1 << 4)) > 0);
}
return answ;
}
}
#endregion Protected Methods
#region Private Methods
private void testBlockRead(int baseAddr, int numByte)
{
int baseHold = 41060;
int[] readTestFull = new int[50];
lgTrace($"-------------------- Inizio test lettura {baseAddr} --------------------");
try
{
stopwatch.Restart();
readTestFull = currPLC.ReadHoldingRegisters(baseAddr - baseHold, numByte);
stopwatch.Stop();
lgTrace($"Stats lettura | {readTestFull.Length} val | {stopwatch.ElapsedMilliseconds}ms");
}
catch
{ }
for (int i = 0; i < readTestFull.Length / 2; i++)
{
int[] thisSet = new int[2];
Array.Copy(readTestFull, i * 2, thisSet, 0, 2);
lgTrace($"{baseAddr + i * 2:000} | HoldingRegisters: {thisSet[0]} / {thisSet[1]} | Val Real: {ModbusClient.ConvertRegistersToFloat(thisSet):N6}");
}
lgTrace("-------------------- Completato test lettura {baseAddr} --------------------");
}
private void testRead()
{
foreach (var item in memSetR)
{
testBlockRead(item.Key, item.Value);
}
}
#endregion Private Methods
}
}
+231 -226
View File
@@ -1,39 +1,16 @@
using CndexLinkDotNet;
using EgwProxy.OsaiCncLib;
using IOB_UT_NEXT;
using MapoSDK;
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.NetworkInformation;
using EgwProxy.OsaiCncLib;
namespace IOB_WIN_NEXT
{
public class IobOSAI : IobGeneric
{
#region Private Fields
/// <summary>
/// LookUpTable di decodifica da CNC a segnali tipo bitmap MAPO
/// </summary>
private Dictionary<string, string> signLUT = new Dictionary<string, string>();
#endregion Private Fields
#region Protected Fields
/// <summary>
/// Struttura dati principale in continuo update...
/// </summary>
protected Cndex.GETINFO1DATA oData;
/// <summary>
/// Oggetto MAIN x connessione OSAI
/// </summary>
protected ComCNOsai OSAI_ref;
#endregion Protected Fields
#region Public Fields
/// <summary>
@@ -145,7 +122,8 @@ namespace IOB_WIN_NEXT
lgInfo("OSAI: inizio gestione contapezzi");
try
{
// verifico quale modalità sia richiesta: STD (6711) oppure BIT (Custom, con indicazione area)
// verifico quale modalità sia richiesta: STD (6711) oppure BIT (Custom, con
// indicazione area)
if (cIobConf.optPar.Count > 0 && !string.IsNullOrEmpty(getOptPar("PZCOUNT_MODE")))
{
if (getOptPar("PZCOUNT_MODE").StartsWith("OVAR"))
@@ -180,204 +158,6 @@ namespace IOB_WIN_NEXT
#endregion Public Constructors
#region Private Methods
/// <summary>
/// Effettua decodifica aree memoria alla bitmap usata x MAPO
/// </summary>
private void decodeToBitmap()
{
// init a zero...
B_input = 0;
// SE SI E' CONNESSO al CNC allora è 1=powerON...
if (OSAI_ref.Connected)
{
B_input += 1 << 0;
}
// decodifico impiegando dictionary... cercando il TIPO di memoria & co...
string bKey = "";
string bVal = "";
for (int i = 0; i < 8; i++)
{
bKey = string.Format("BIT{0}", i);
// cerco se ci sia in LUT
if (signLUT.ContainsKey(bKey))
{
// recupero nome variabile...
bVal = signLUT[bKey];
// se l'area è PZCOUNT... processo PUNTUALMENTE il CONTAPEZZI...
if (bVal.StartsWith("PZCOUNT"))
{
// procedo SOLO SE è enabled IOB
if (IobOnline)
{
try
{
currODL = utils.callUrl(urlGetCurrODL);
// solo SE HO un ODL...
if (string.IsNullOrEmpty(currODL) || currODL == "0")
{
if (periodicLog)
{
lgInfo(string.Format("Osai | Lettura ODL andata a vuoto: currODL: {0}", currODL));
}
}
else
{
lgInfo(string.Format("Osai | Lettura ODL, currODL: {0} --> currIdxODL prec: {1}", currODL, currIdxODL));
// provo a salvare nuovo ODL
int.TryParse(currODL, out currIdxODL);
}
}
catch (Exception exc)
{
if (DateTime.Now.Subtract(lastWarnODL).TotalSeconds > 15)
{
lgError(exc, "Errore in fase di chiamata URL x ODL corrente | URL chiamato: {0}", urlGetCurrODL);
lastWarnODL = DateTime.Now;
}
}
}
else
{
// imposto currODL a vuoto!
currODL = "";
if (periodicLog)
{
lgInfo($"OSAI | Lettura ODL non effettuata: IobOnline: {IobOnline} | currODL impostato a vuoto");
}
}
if (!string.IsNullOrEmpty(currODL) && currODL != "0")
{
// controllo se è passato intervallo minimo tra 2 controlli/elaborazioni x distanziare invio e ridurre letture
if (DateTime.Now >= lastPzCountSend.AddMilliseconds(pzCountDelay))
{
// se sono differenti MOSTRO...
if (contapezziPLC != contapezziIOB)
{
// registro contapezzi
lgInfo($"Differenza Contapezzi: contapezziPLC: {contapezziPLC} | contapezziIOB {contapezziIOB}");
}
// verifico se variato contapezzi in area STD PAR6711... e se passato ritardo minimo...
if (contapezziPLC > contapezziIOB)
{
// salvo nuovo contapezzi (incremento di 1...) + richiesta refresh conteggio
contapezziIOB++;
needRefreshPzCount = true;
// salvo in semaforo!
B_input += 1 << 2;
// registro contapezzi
lgInfo($"contapezziPLC OSAI: {contapezziPLC} | contapezziIOB {contapezziIOB}");
}
// invio a server contapezzi (aggiornato)
string retVal = utils.callUrl(urlSetPzCount + contapezziIOB.ToString());
// verifica se tutto OK
if (retVal != contapezziIOB.ToString())
{
// errore salvataggio contapezzi
lgInfo($"Errore salvataggio Contapezzi OSAI: contapezziPLC {contapezziPLC} | contapezziIOB {contapezziIOB} | risposta: {retVal}");
// rileggo il counter pezzi da server
pzCntReload(true);
}
// resetto timer...
lastPzCountSend = DateTime.Now;
}
}
else
{
if (DateTime.Now >= lastPzCountSend.AddMilliseconds(pzCountDelay))
{
lgInfo($"Attenzione: mancanza ODL non procedo con gestione contapezzi. contapezziPLC OSAI: {contapezziPLC} | contapezziIOB {contapezziIOB}");
// resetto timer...
lastPzCountSend = DateTime.Now;
}
}
}
// controllo le condizioni x costruire il bit1 RUN!
if (oData.mode_select == 2 && oData.status == 2)
{
B_input += 1 << 1;
}
// errore su bit3
if (oData.mode_select == 6)
{
B_input += 1 << 3;
}
// auto su bit4
if (oData.mode_select != 2)
{
B_input += 1 << 4;
}
// emergenza su bit5
if (oData.mode_select == 9)
{
B_input += 1 << 5;
}
}
}
// log opzionale!
if (verboseLog)
{
lgInfo(string.Format("Trasformazione B_input: {0}", B_input));
}
}
#endregion Private Methods
#region Protected Methods
/// <summary>
/// Decodifica del MODE selezionato
/// </summary>
/// <param name="mode"></param>
/// <returns></returns>
protected static CNC_MODE decodeModeOsai(int mode)
{
CNC_MODE answ = CNC_MODE.ND;
switch (mode)
{
case 1:
answ = CNC_MODE.MDI;
break;
case 2:
answ = CNC_MODE.AUTO;
break;
case 3:
answ = CNC_MODE.SEMI;
break;
case 4:
answ = CNC_MODE.JOG_MAN;
break;
case 5:
answ = CNC_MODE.JOG_INC;
break;
case 6:
answ = CNC_MODE.PROFILE;
break;
case 7:
answ = CNC_MODE.HOME;
break;
case 8:
answ = CNC_MODE.HANDLE_INC;
break;
default:
break;
}
return answ;
}
#endregion Protected Methods
#region Public Methods
/// <summary>
@@ -481,7 +261,8 @@ namespace IOB_WIN_NEXT
{
try
{
// verifico quale modalità sia richiesta: STD (6711) oppure BIT (Custom, con indicazione area)
// verifico quale modalità sia richiesta: STD (6711) oppure BIT (Custom, con
// indicazione area)
if (cIobConf.optPar.Count > 0 && !string.IsNullOrEmpty(getOptPar("PZCOUNT_MODE")))
{
string memAddr = getOptPar("PZCOUNT_MODE");
@@ -588,8 +369,8 @@ namespace IOB_WIN_NEXT
}
/// <summary>
/// Effettua lettura semafori principale
/// <paramref name="currDispData">Parametri da aggiornare x display in form</paramref>
/// Effettua lettura semafori principale <paramref name="currDispData">Parametri da
/// aggiornare x display in form</paramref>
/// </summary>
public override void readSemafori(ref newDisplayData currDispData)
{
@@ -758,5 +539,229 @@ namespace IOB_WIN_NEXT
}
#endregion Public Methods
#region Protected Fields
/// <summary>
/// Struttura dati principale in continuo update...
/// </summary>
protected Cndex.GETINFO1DATA oData;
/// <summary>
/// Oggetto MAIN x connessione OSAI
/// </summary>
protected ComCNOsai OSAI_ref;
#endregion Protected Fields
#region Protected Methods
/// <summary>
/// Decodifica del MODE selezionato
/// </summary>
/// <param name="mode"></param>
/// <returns></returns>
protected static CNC_MODE decodeModeOsai(int mode)
{
CNC_MODE answ = CNC_MODE.ND;
switch (mode)
{
case 1:
answ = CNC_MODE.MDI;
break;
case 2:
answ = CNC_MODE.AUTO;
break;
case 3:
answ = CNC_MODE.SEMI;
break;
case 4:
answ = CNC_MODE.JOG_MAN;
break;
case 5:
answ = CNC_MODE.JOG_INC;
break;
case 6:
answ = CNC_MODE.PROFILE;
break;
case 7:
answ = CNC_MODE.HOME;
break;
case 8:
answ = CNC_MODE.HANDLE_INC;
break;
default:
break;
}
return answ;
}
#endregion Protected Methods
#region Private Fields
/// <summary>
/// LookUpTable di decodifica da CNC a segnali tipo bitmap MAPO
/// </summary>
private Dictionary<string, string> signLUT = new Dictionary<string, string>();
#endregion Private Fields
#region Private Methods
/// <summary>
/// Effettua decodifica aree memoria alla bitmap usata x MAPO
/// </summary>
private void decodeToBitmap()
{
// init a zero...
B_input = 0;
// SE SI E' CONNESSO al CNC allora è 1=powerON...
if (OSAI_ref.Connected)
{
B_input += 1 << 0;
}
// decodifico impiegando dictionary... cercando il TIPO di memoria & co...
string bKey = "";
string bVal = "";
for (int i = 0; i < 8; i++)
{
bKey = string.Format("BIT{0}", i);
// cerco se ci sia in LUT
if (signLUT.ContainsKey(bKey))
{
// recupero nome variabile...
bVal = signLUT[bKey];
// se l'area è PZCOUNT... processo PUNTUALMENTE il CONTAPEZZI...
if (bVal.StartsWith("PZCOUNT"))
{
// procedo SOLO SE è enabled IOB
if (IobOnline)
{
try
{
currODL = utils.callUrl(urlGetCurrODL);
// solo SE HO un ODL...
if (string.IsNullOrEmpty(currODL) || currODL == "0")
{
if (periodicLog)
{
lgInfo(string.Format("Osai | Lettura ODL andata a vuoto: currODL: {0}", currODL));
}
}
else
{
lgInfo(string.Format("Osai | Lettura ODL, currODL: {0} --> currIdxODL prec: {1}", currODL, currIdxODL));
// provo a salvare nuovo ODL
int.TryParse(currODL, out currIdxODL);
}
}
catch (Exception exc)
{
if (DateTime.Now.Subtract(lastWarnODL).TotalSeconds > 15)
{
lgError(exc, "Errore in fase di chiamata URL x ODL corrente | URL chiamato: {0}", urlGetCurrODL);
lastWarnODL = DateTime.Now;
}
}
}
else
{
// imposto currODL a vuoto!
currODL = "";
if (periodicLog)
{
lgInfo($"OSAI | Lettura ODL non effettuata: IobOnline: {IobOnline} | currODL impostato a vuoto");
}
}
if (!string.IsNullOrEmpty(currODL) && currODL != "0")
{
// controllo se è passato intervallo minimo tra 2 controlli/elaborazioni
// x distanziare invio e ridurre letture
if (DateTime.Now >= lastPzCountSend.AddMilliseconds(pzCountDelay))
{
// se sono differenti MOSTRO...
if (contapezziPLC != contapezziIOB)
{
// registro contapezzi
lgInfo($"Differenza Contapezzi: contapezziPLC: {contapezziPLC} | contapezziIOB {contapezziIOB}");
}
// verifico se variato contapezzi in area STD PAR6711... e se
// passato ritardo minimo...
if (contapezziPLC > contapezziIOB)
{
// salvo nuovo contapezzi (incremento di 1...) + richiesta
// refresh conteggio
contapezziIOB++;
needRefreshPzCount = true;
// salvo in semaforo!
B_input += 1 << 2;
// registro contapezzi
lgInfo($"contapezziPLC OSAI: {contapezziPLC} | contapezziIOB {contapezziIOB}");
}
// invio a server contapezzi (aggiornato)
string retVal = utils.callUrl(urlSetPzCount + contapezziIOB.ToString());
// verifica se tutto OK
if (retVal != contapezziIOB.ToString())
{
// errore salvataggio contapezzi
lgInfo($"Errore salvataggio Contapezzi OSAI: contapezziPLC {contapezziPLC} | contapezziIOB {contapezziIOB} | risposta: {retVal}");
// rileggo il counter pezzi da server
pzCntReload(true);
}
// resetto timer...
lastPzCountSend = DateTime.Now;
}
}
else
{
if (DateTime.Now >= lastPzCountSend.AddMilliseconds(pzCountDelay))
{
lgInfo($"Attenzione: mancanza ODL non procedo con gestione contapezzi. contapezziPLC OSAI: {contapezziPLC} | contapezziIOB {contapezziIOB}");
// resetto timer...
lastPzCountSend = DateTime.Now;
}
}
}
// controllo le condizioni x costruire il bit1 RUN!
if (oData.mode_select == 2 && oData.status == 2)
{
B_input += 1 << 1;
}
// errore su bit3
if (oData.mode_select == 6)
{
B_input += 1 << 3;
}
// auto su bit4
if (oData.mode_select != 2)
{
B_input += 1 << 4;
}
// emergenza su bit5
if (oData.mode_select == 9)
{
B_input += 1 << 5;
}
}
}
// log opzionale!
if (verboseLog)
{
lgInfo(string.Format("Trasformazione B_input: {0}", B_input));
}
}
#endregion Private Methods
}
}
+550 -544
View File
File diff suppressed because it is too large Load Diff
+78 -6
View File
@@ -28,6 +28,17 @@ namespace IOB_WIN_NEXT
{
// gestione invio ritardato contapezzi
pzCountDelay = utils.CRI("pzCountDelay");
// gestione restart OpcUa client...
if (!string.IsNullOrEmpty(getOptPar("MAX_TRY_PING")))
{
int.TryParse(getOptPar("MAX_TRY_PING"), out maxTryPing);
}
enablePzCountByApp = utils.CRB("enableContapezzi");
enablePzCountByIob = (getOptPar("ENABLE_PZCOUNT") == "TRUE");
disablePzCounteByIob = (getOptPar("DISABLE_PZCOUNT") == "TRUE");
// gestione data filtering...
if (!string.IsNullOrEmpty(getOptPar("ENABLE_DATA_FILTER")))
{
@@ -152,12 +163,31 @@ namespace IOB_WIN_NEXT
return outVal;
}
/// <summary>
/// Recupero allarmi specifico x OPC-UA
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
protected override int getAlarmStatus(BaseAlarmConf item)
{
int answ = 0;
// recupero valore in formato stringa...
string currStatus = getDataItemValue(item.memAddr);
// se non nullo --> recupero int
if (!string.IsNullOrEmpty(currStatus))
{
int.TryParse(currStatus, out answ);
}
return answ;
}
/// <summary>
/// Effettua vero processing contapezzi
/// </summary>
public override void processContapezzi()
{
if (utils.CRB("enableContapezzi"))
if ((enablePzCountByApp || enablePzCountByIob) && !(disablePzCounteByIob))
{
// da ridefinire la gestione base del contapezzi OPC-UA...
}
@@ -263,7 +293,7 @@ namespace IOB_WIN_NEXT
// in primis salvo data ping...
lastPING = DateTime.Now;
// se passa il ping faccio il resto...
if (testPingMachine == IPStatus.Success)
if (testPingMachine == IPStatus.Success || opcUaParams.forcePingOk)
{
string szStatusConnection = "";
try
@@ -471,6 +501,35 @@ namespace IOB_WIN_NEXT
return changed;
}
internal void procRunMode(ref string currRun)
{
// variabili RUN... se richiesto invio runMode
if (opcUaParams.runModeSend)
{
if (!string.IsNullOrEmpty(opcUaParams.keyRunMode))
{
currRun = getDataItemValue(opcUaParams.keyRunMode);
if (!string.IsNullOrEmpty(currRun))
{
// se ho valore --> invio
string sVal = "";
string descr = $"RunModeVal";
DateTime locTStamp = DateTime.Now;
sVal = $"Change: {locTStamp.ToString()} | descr: {descr} | Id: {opcUaParams.keyRunMode} | Val: {currRun}";
accodaFLog(sVal, qEncodeFLog(descr, currRun));
// se richiesto provo a tradurre
if (opcUaParams.runModeTrad)
{
string RunModeDescr = itemTranslation("RunMode", currRun);
descr = $"RunMode";
accodaFLog(sVal, qEncodeFLog(descr, RunModeDescr));
}
}
}
}
}
internal void sendDataItemListToServer(NodeId StartNodeId)
{
// converto gli attuali nell'elenco dataitem...
@@ -917,16 +976,29 @@ namespace IOB_WIN_NEXT
// se valido il check ping lo eseguo... altrimenti lo do x buono
bool checkPing = !opcUaParams.pingAsPowerOn;
string currRun = "";
if (!checkPing)
int currTryPing = maxTryPing;
while (currTryPing > 0 && !checkPing)
{
checkPing = (testPingMachine == IPStatus.Success);
if (!checkPing)
{
checkPing = (testPingMachine == IPStatus.Success);
}
currTryPing--;
// se ping KO --> aspetto prima di ripetere test
if (!checkPing)
{
Random rand = new Random();
Thread.Sleep(rand.Next(pingServerMsTimeout * 2));
}
}
// bit 0 (poweron) imposto a 1 SE pingo + PowerOn=="ON"...
bool powerOnOk = checkPing && hasPowerOn;
// controllo se sono poweroff e se non ho dati buoni da > lastCurrentMaxElapsed --> disconnetto
if (!powerOnOk && adesso.Subtract(lastCurrent).TotalSeconds > lastCurrentMaxElapsed)
if (!powerOnOk && (adesso.Subtract(lastCurrent).TotalSeconds > lastCurrentMaxElapsed))
{
lgInfo("Timeout per mencata comunicazione --> disconnessione adapter OpcUa!");
tryDisconnect();
}
@@ -1108,7 +1180,7 @@ namespace IOB_WIN_NEXT
application.ApplicationType = ApplicationType.Client;
// load the application configuration.
string confPath = $"{Application.StartupPath}\\DATA\\CONF\\IobOpcUaClient.Config.xml";
string confPath = $"{Application.StartupPath}\\DATA\\IobOpcUaClient.Config.xml";
await application.LoadApplicationConfiguration(confPath, silent: false).ConfigureAwait(false);
// check the application certificate.
await application.CheckApplicationInstanceCertificate(silent: false, minimumKeySize: 0).ConfigureAwait(false);
+128 -108
View File
@@ -3,26 +3,12 @@ using Newtonsoft.Json;
using Opc.Ua;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading.Tasks;
namespace IOB_WIN_NEXT
{
public class IobOpcUaCMS : IobOpcUa
{
#region Protected Fields
/// <summary>
/// Modalità cambio ODL
/// </summary>
protected string CHANGE_ODL_MODE = "";
protected bool testDone = false;
#endregion Protected Fields
#region Public Constructors
/// <summary>
@@ -44,6 +30,113 @@ namespace IOB_WIN_NEXT
#endregion Public Constructors
#region Public Methods
/// <summary>
/// Processo i task richiesti e li elimino dalla coda 1:1
/// </summary>
/// <param name="task2exe"></param>
public override Dictionary<string, string> executeTasks(Dictionary<string, string> task2exe)
{
// uso metodo base x ora
return base.executeTasks(task2exe);
}
/// <summary>
/// Effettua vero processing contapezzi
/// </summary>
public override void processContapezzi()
{
if (utils.CRB("enableContapezzi"))
{
// check condizione validazione
if (checkMultiCondition(opcUaParams.condCountEnabled) || opcUaParams.condCountEnabled.checkList.Count == 0)
{
// cerco parametro contapezzi...
string currPzCount = getDataItemValue(opcUaParams.keyPartCount);
// se ho un contapezzi... processo...
if (!string.IsNullOrEmpty(currPzCount))
{
int newVal = -1;
bool fatto = Int32.TryParse(currPzCount, out newVal);
if (fatto)
{
// gestione decremento contapezzi: viene "messo via" solo SE c'è un
// effettivo decremento contapezzi...
if (newVal < contapezziPLC)
{
pzCountResetted = true;
// incremento contatore richiesta
countKeyRichiesta = countKeyRichiesta + 1;
// log
lgInfo("Contapezzi resettato (PLC) --> pzCountResetted = true");
}
// salvo nuovo valore contapezziPLC
contapezziPLC = newVal > -1 ? newVal : contapezziPLC;
}
else
{
lgError($"Errore in decodifica valore contapezzi, valore rilevato: {currPzCount}");
}
}
else
{
lgError($"Errore in decodifica valore contapezzi da {opcUaParams.keyPartCount} | valore vuoto!");
}
}
if (CHANGE_ODL_MODE == "PZCOUNT_RESET")
{
// controllo comunque, se è ZERO il contapezzi, e sul server è maggiore il
// valore x ODL e NON abilitato il trigger reset --> abilito trigger...
if (!pzCountResetted && contapezziPLC == 0 && contapezziIOB > 0)
{
pzCountResetted = true;
// incremento contatore richiesta
countKeyRichiesta = countKeyRichiesta + 1;
// log
lgInfo("Contapezzi resettato (PLC==0 e IOB>PLC) --> pzCountResetted = true");
}
}
}
}
/// <summary>
/// Effettua reset del contapezzi, NON POSSIBILE in questa versione
/// </summary>
/// <returns></returns>
public override bool resetcontapezziPLC()
{
bool answ = false;
return answ;
}
/// <summary>
/// Effettua IMPOSTAZIONE FORZATA del contapezzi, NON POSSIBILE in questa versione
/// </summary>
/// <returns></returns>
public override bool setcontapezziPLC(int newPzCount)
{
bool answ = false;
return answ;
}
#endregion Public Methods
#region Protected Fields
/// <summary>
/// Modalità cambio ODL
/// </summary>
protected string CHANGE_ODL_MODE = "";
protected bool testDone = false;
#endregion Protected Fields
#region Protected Methods
/// <summary>
@@ -85,6 +178,27 @@ namespace IOB_WIN_NEXT
// variabili RUN...
currRun = getDataItemValue(opcUaParams.keyRunMode);
// variabili RUN... se richiesto invio runMode
if (opcUaParams.runModeSend)
{
if (!string.IsNullOrEmpty(currRun))
{
// se ho valore --> invio
string sVal = "";
string descr = $"RunModeVal";
DateTime locTStamp = DateTime.Now;
sVal = $"Change: {locTStamp.ToString()} | descr: {descr} | Id: {opcUaParams.keyRunMode} | Val: {currRun}";
accodaFLog(sVal, qEncodeFLog(descr, currRun));
// se richiesto provo a tradurre
if (opcUaParams.runModeTrad)
{
string RunModeDescr = itemTranslation("RunMode", currRun);
descr = $"RunMode";
accodaFLog(sVal, qEncodeFLog(descr, RunModeDescr));
}
}
}
// salvo running come = working...
isRunning = isWorking;
@@ -274,99 +388,5 @@ namespace IOB_WIN_NEXT
}
#endregion Protected Methods
#region Public Methods
/// <summary>
/// Processo i task richiesti e li elimino dalla coda 1:1
/// </summary>
/// <param name="task2exe"></param>
public override Dictionary<string, string> executeTasks(Dictionary<string, string> task2exe)
{
// uso metodo base x ora
return base.executeTasks(task2exe);
}
/// <summary>
/// Effettua vero processing contapezzi
/// </summary>
public override void processContapezzi()
{
if (utils.CRB("enableContapezzi"))
{
// check condizione validazione
if (checkMultiCondition(opcUaParams.condCountEnabled) || opcUaParams.condCountEnabled.checkList.Count == 0)
{
// cerco parametro contapezzi...
string currPzCount = getDataItemValue(opcUaParams.keyPartCount);
// se ho un contapezzi... processo...
if (!string.IsNullOrEmpty(currPzCount))
{
int newVal = -1;
bool fatto = Int32.TryParse(currPzCount, out newVal);
if (fatto)
{
// gestione decremento contapezzi: viene "messo via" solo SE c'è un effettivo decremento contapezzi...
if (newVal < contapezziPLC)
{
pzCountResetted = true;
// incremento contatore richiesta
countKeyRichiesta = countKeyRichiesta + 1;
// log
lgInfo("Contapezzi resettato (PLC) --> pzCountResetted = true");
}
// salvo nuovo valore contapezziPLC
contapezziPLC = newVal > -1 ? newVal : contapezziPLC;
}
else
{
lgError($"Errore in decodifica valore contapezzi, valore rilevato: {currPzCount}");
}
}
else
{
lgError($"Errore in decodifica valore contapezzi da {opcUaParams.keyPartCount} | valore vuoto!");
}
}
if (CHANGE_ODL_MODE == "PZCOUNT_RESET")
{
// controllo comunque, se è ZERO il contapezzi, e sul server è maggiore il valore x ODL e NON abilitato il trigger reset --> abilito trigger...
if (!pzCountResetted && contapezziPLC == 0 && contapezziIOB > 0)
{
pzCountResetted = true;
// incremento contatore richiesta
countKeyRichiesta = countKeyRichiesta + 1;
// log
lgInfo("Contapezzi resettato (PLC==0 e IOB>PLC) --> pzCountResetted = true");
}
}
}
}
/// <summary>
/// Effettua reset del contapezzi, NON POSSIBILE in questa versione
/// </summary>
/// <returns></returns>
public override bool resetcontapezziPLC()
{
bool answ = false;
return answ;
}
/// <summary>
/// Effettua IMPOSTAZIONE FORZATA del contapezzi, NON POSSIBILE in questa versione
/// </summary>
/// <returns></returns>
public override bool setcontapezziPLC(int newPzCount)
{
bool answ = false;
return answ;
}
#endregion Public Methods
}
}
+112 -109
View File
@@ -3,26 +3,12 @@ using Newtonsoft.Json;
using Opc.Ua;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading.Tasks;
namespace IOB_WIN_NEXT
{
public class IobOpcUaEwon : IobOpcUa
{
#region Protected Fields
/// <summary>
/// Modalità cambio ODL
/// </summary>
protected string CHANGE_ODL_MODE = "";
protected bool testDone = false;
#endregion Protected Fields
#region Public Constructors
/// <summary>
@@ -43,6 +29,113 @@ namespace IOB_WIN_NEXT
#endregion Public Constructors
#region Public Methods
/// <summary>
/// Processo i task richiesti e li elimino dalla coda 1:1
/// </summary>
/// <param name="task2exe"></param>
public override Dictionary<string, string> executeTasks(Dictionary<string, string> task2exe)
{
// uso metodo base x ora
return base.executeTasks(task2exe);
}
/// <summary>
/// Effettua vero processing contapezzi
/// </summary>
public override void processContapezzi()
{
if (utils.CRB("enableContapezzi"))
{
// check condizione validazione
if (checkMultiCondition(opcUaParams.condCountEnabled) || opcUaParams.condCountEnabled.checkList.Count == 0)
{
// cerco parametro contapezzi...
string currPzCount = getDataItemValue(opcUaParams.keyPartCount);
// se ho un contapezzi... processo...
if (!string.IsNullOrEmpty(currPzCount))
{
int newVal = -1;
bool fatto = Int32.TryParse(currPzCount, out newVal);
if (fatto)
{
// gestione decremento contapezzi: viene "messo via" solo SE c'è un
// effettivo decremento contapezzi...
if (newVal < contapezziPLC)
{
pzCountResetted = true;
// incremento contatore richiesta
countKeyRichiesta = countKeyRichiesta + 1;
// log
lgInfo("Contapezzi resettato (PLC) --> pzCountResetted = true");
}
// salvo nuovo valore contapezziPLC
contapezziPLC = newVal > -1 ? newVal : contapezziPLC;
}
else
{
lgError($"Errore in decodifica valore contapezzi, valore rilevato: {currPzCount}");
}
}
else
{
lgError("Errore in decodifica valore contapezzi, valore vuoto!");
}
}
if (CHANGE_ODL_MODE == "PZCOUNT_RESET")
{
// controllo comunque, se è ZERO il contapezzi, e sul server è maggiore il
// valore x ODL e NON abilitato il trigger reset --> abilito trigger...
if (!pzCountResetted && contapezziPLC == 0 && contapezziIOB > 0)
{
pzCountResetted = true;
// incremento contatore richiesta
countKeyRichiesta = countKeyRichiesta + 1;
// log
lgInfo("Contapezzi resettato (PLC==0 e IOB>PLC) --> pzCountResetted = true");
}
}
}
}
/// <summary>
/// Effettua reset del contapezzi, NON POSSIBILE in questa versione
/// </summary>
/// <returns></returns>
public override bool resetcontapezziPLC()
{
bool answ = false;
return answ;
}
/// <summary>
/// Effettua IMPOSTAZIONE FORZATA del contapezzi, NON POSSIBILE in questa versione
/// </summary>
/// <returns></returns>
public override bool setcontapezziPLC(int newPzCount)
{
bool answ = false;
return answ;
}
#endregion Public Methods
#region Protected Fields
/// <summary>
/// Modalità cambio ODL
/// </summary>
protected string CHANGE_ODL_MODE = "";
protected bool testDone = false;
#endregion Protected Fields
#region Protected Methods
/// <summary>
@@ -82,11 +175,15 @@ namespace IOB_WIN_NEXT
{
B_input = powerOnOk ? 1 : 0;
#if false
// variabili RUN...
if (!string.IsNullOrEmpty(opcUaParams.keyRunMode))
{
currRun = getDataItemValue(opcUaParams.keyRunMode);
}
#endif
procRunMode(ref currRun);
// salvo running come = working...
isRunning = isWorking;
@@ -137,7 +234,7 @@ namespace IOB_WIN_NEXT
List<WriteValue> nodes2Write = new List<WriteValue>();
nodes2Write.Add(commWriteVal);
UA_ref.WriteNodes(nodes2Write);
}
catch (Exception exc)
@@ -271,99 +368,5 @@ namespace IOB_WIN_NEXT
}
#endregion Protected Methods
#region Public Methods
/// <summary>
/// Processo i task richiesti e li elimino dalla coda 1:1
/// </summary>
/// <param name="task2exe"></param>
public override Dictionary<string, string> executeTasks(Dictionary<string, string> task2exe)
{
// uso metodo base x ora
return base.executeTasks(task2exe);
}
/// <summary>
/// Effettua vero processing contapezzi
/// </summary>
public override void processContapezzi()
{
if (utils.CRB("enableContapezzi"))
{
// check condizione validazione
if (checkMultiCondition(opcUaParams.condCountEnabled) || opcUaParams.condCountEnabled.checkList.Count == 0)
{
// cerco parametro contapezzi...
string currPzCount = getDataItemValue(opcUaParams.keyPartCount);
// se ho un contapezzi... processo...
if (!string.IsNullOrEmpty(currPzCount))
{
int newVal = -1;
bool fatto = Int32.TryParse(currPzCount, out newVal);
if (fatto)
{
// gestione decremento contapezzi: viene "messo via" solo SE c'è un effettivo decremento contapezzi...
if (newVal < contapezziPLC)
{
pzCountResetted = true;
// incremento contatore richiesta
countKeyRichiesta = countKeyRichiesta + 1;
// log
lgInfo("Contapezzi resettato (PLC) --> pzCountResetted = true");
}
// salvo nuovo valore contapezziPLC
contapezziPLC = newVal > -1 ? newVal : contapezziPLC;
}
else
{
lgError($"Errore in decodifica valore contapezzi, valore rilevato: {currPzCount}");
}
}
else
{
lgError("Errore in decodifica valore contapezzi, valore vuoto!");
}
}
if (CHANGE_ODL_MODE == "PZCOUNT_RESET")
{
// controllo comunque, se è ZERO il contapezzi, e sul server è maggiore il valore x ODL e NON abilitato il trigger reset --> abilito trigger...
if (!pzCountResetted && contapezziPLC == 0 && contapezziIOB > 0)
{
pzCountResetted = true;
// incremento contatore richiesta
countKeyRichiesta = countKeyRichiesta + 1;
// log
lgInfo("Contapezzi resettato (PLC==0 e IOB>PLC) --> pzCountResetted = true");
}
}
}
}
/// <summary>
/// Effettua reset del contapezzi, NON POSSIBILE in questa versione
/// </summary>
/// <returns></returns>
public override bool resetcontapezziPLC()
{
bool answ = false;
return answ;
}
/// <summary>
/// Effettua IMPOSTAZIONE FORZATA del contapezzi, NON POSSIBILE in questa versione
/// </summary>
/// <returns></returns>
public override bool setcontapezziPLC(int newPzCount)
{
bool answ = false;
return answ;
}
#endregion Public Methods
}
}
+8 -16
View File
@@ -1,22 +1,10 @@
using MapoSDK;
using Newtonsoft.Json;
using Opc.Ua;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading.Tasks;
namespace IOB_WIN_NEXT
{
public class IobOpcUaEwonBLM : IobOpcUaEwon
{
#region Protected Fields
#endregion Protected Fields
#region Public Constructors
/// <summary>
@@ -37,6 +25,10 @@ namespace IOB_WIN_NEXT
sendKeyRichiesta = true;
}
#endregion Public Constructors
#region Protected Methods
/// <summary>
/// Effettua vera scrittura parametri
/// </summary>
@@ -49,7 +41,8 @@ namespace IOB_WIN_NEXT
if (opcUaParams.SetupConf.SetupMode == IOB_UT_NEXT.MachineSetupMode.MECOLPRESS)
{
List<WriteValue> nodes2Write = new List<WriteValue>();
// faccio un check tra i valori in memoria che devono corrispondere e se NON corrispondono --> metto valore in scrittura...
// faccio un check tra i valori in memoria che devono corrispondere e se NON
// corrispondono --> metto valore in scrittura...
int numDiff = 0;
foreach (var item in opcUaParams.SetupConf.checkParList)
{
@@ -98,11 +91,10 @@ namespace IOB_WIN_NEXT
UA_ref.WriteNodes(nodes2Write);
}
}
}
}
#endif
}
#endregion Public Constructors
#endregion Protected Methods
}
}
+8 -14
View File
@@ -1,22 +1,12 @@
using MapoSDK;
using Newtonsoft.Json;
using Opc.Ua;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading.Tasks;
namespace IOB_WIN_NEXT
{
public class IobOpcUaEwonMecolpress : IobOpcUaEwon
{
#region Protected Fields
#endregion Protected Fields
#region Public Constructors
/// <summary>
@@ -37,6 +27,10 @@ namespace IOB_WIN_NEXT
sendKeyRichiesta = true;
}
#endregion Public Constructors
#region Protected Methods
/// <summary>
/// Effettua vera scrittura parametri
/// </summary>
@@ -49,7 +43,8 @@ namespace IOB_WIN_NEXT
if (opcUaParams.SetupConf.SetupMode == IOB_UT_NEXT.MachineSetupMode.MECOLPRESS)
{
List<WriteValue> nodes2Write = new List<WriteValue>();
// faccio un check tra i valori in memoria che devono corrispondere e se NON corrispondono --> metto valore in scrittura...
// faccio un check tra i valori in memoria che devono corrispondere e se NON
// corrispondono --> metto valore in scrittura...
int numDiff = 0;
foreach (var item in opcUaParams.SetupConf.checkParList)
{
@@ -86,7 +81,7 @@ namespace IOB_WIN_NEXT
// accodo x scrittura
nodes2Write.Add(commWriteVal);
lgInfo($"richiesta scrittura valore | nodeId: {commWriteVal.NodeId } | targetPar: {item.TargetParam} | val {commWriteVal.Value.Value}");
lgInfo($"richiesta scrittura valore | nodeId: {commWriteVal.NodeId} | targetPar: {item.TargetParam} | val {commWriteVal.Value.Value}");
}
// x ora NON eseguo
@@ -101,7 +96,6 @@ namespace IOB_WIN_NEXT
}
}
#endregion Public Constructors
#endregion Protected Methods
}
}
+66 -64
View File
@@ -31,6 +31,72 @@ namespace IOB_WIN_NEXT
#endregion Public Constructors
#region Public Methods
/// <summary>
/// Effettua vero processing contapezzi
/// </summary>
public override void processContapezzi()
{
if (utils.CRB("enableContapezzi"))
{
// check condizione validazione
if (checkMultiCondition(opcUaParams.condCountEnabled) || opcUaParams.condCountEnabled.checkList.Count == 0)
{
// cerco parametro contapezzi...
string currPzCount = getDataItemValue(opcUaParams.keyPartCount);
// se ho un contapezzi... processo...
if (!string.IsNullOrEmpty(currPzCount))
{
int newVal = -1;
bool fatto = Int32.TryParse(currPzCount, out newVal);
if (fatto)
{
// gestione decremento contapezzi: viene "messo via" solo SE c'è un
// effettivo decremento contapezzi...
if (newVal < contapezziPLC)
{
pzCountResetted = true;
// incremento contatore richiesta
countKeyRichiesta = countKeyRichiesta + 1;
// log
lgInfo("Contapezzi resettato (PLC) --> pzCountResetted = true");
}
// salvo nuovo valore contapezziPLC
contapezziPLC = newVal > -1 ? newVal : contapezziPLC;
}
else
{
lgError($"Errore in decodifica valore contapezzi, valore rilevato: {currPzCount}");
}
}
else
{
lgError("Errore in decodifica valore contapezzi, valore vuoto!");
}
}
if (CHANGE_ODL_MODE == "PZCOUNT_RESET")
{
// controllo comunque, se è ZERO il contapezzi, e sul server è maggiore il
// valore x ODL e NON abilitato il trigger reset --> abilito trigger...
if (!pzCountResetted && contapezziPLC == 0 && contapezziIOB > 0)
{
pzCountResetted = true;
// incremento contatore richiesta
countKeyRichiesta = countKeyRichiesta + 1;
// log
lgInfo("Contapezzi resettato (PLC==0 e IOB>PLC) --> pzCountResetted = true");
}
}
}
}
#endregion Public Methods
#region Protected Methods
/// <summary>
@@ -151,69 +217,5 @@ namespace IOB_WIN_NEXT
}
#endregion Protected Methods
#region Public Methods
/// <summary>
/// Effettua vero processing contapezzi
/// </summary>
public override void processContapezzi()
{
if (utils.CRB("enableContapezzi"))
{
// check condizione validazione
if (checkMultiCondition(opcUaParams.condCountEnabled) || opcUaParams.condCountEnabled.checkList.Count == 0)
{
// cerco parametro contapezzi...
string currPzCount = getDataItemValue(opcUaParams.keyPartCount);
// se ho un contapezzi... processo...
if (!string.IsNullOrEmpty(currPzCount))
{
int newVal = -1;
bool fatto = Int32.TryParse(currPzCount, out newVal);
if (fatto)
{
// gestione decremento contapezzi: viene "messo via" solo SE c'è un effettivo decremento contapezzi...
if (newVal < contapezziPLC)
{
pzCountResetted = true;
// incremento contatore richiesta
countKeyRichiesta = countKeyRichiesta + 1;
// log
lgInfo("Contapezzi resettato (PLC) --> pzCountResetted = true");
}
// salvo nuovo valore contapezziPLC
contapezziPLC = newVal > -1 ? newVal : contapezziPLC;
}
else
{
lgError($"Errore in decodifica valore contapezzi, valore rilevato: {currPzCount}");
}
}
else
{
lgError("Errore in decodifica valore contapezzi, valore vuoto!");
}
}
if (CHANGE_ODL_MODE == "PZCOUNT_RESET")
{
// controllo comunque, se è ZERO il contapezzi, e sul server è maggiore il valore x ODL e NON abilitato il trigger reset --> abilito trigger...
if (!pzCountResetted && contapezziPLC == 0 && contapezziIOB > 0)
{
pzCountResetted = true;
// incremento contatore richiesta
countKeyRichiesta = countKeyRichiesta + 1;
// log
lgInfo("Contapezzi resettato (PLC==0 e IOB>PLC) --> pzCountResetted = true");
}
}
}
}
#endregion Public Methods
}
}
+392
View File
@@ -0,0 +1,392 @@
using MapoSDK;
using Newtonsoft.Json;
using Opc.Ua;
using System;
using System.Collections.Generic;
using System.Net.NetworkInformation;
namespace IOB_WIN_NEXT
{
public class IobOpcUaMBH : IobOpcUa
{
#region Public Constructors
/// <summary>
/// Estende l'init della classe base, impiegando il pacchetto Nuget OPC-UA foundation con la
/// gestione specifica per MBH OPC-UA (es OPC, Cimolai per Baglietto) https://github.com/OPCFoundation/UA-.NETStandard
/// </summary>
/// <param name="caller"></param>
/// <param name="IOBConf"></param>
public IobOpcUaMBH(AdapterForm caller, IobConfiguration IOBConf) : base(caller, IOBConf)
{
lgInfo("Init OpcUa MBH");
// inizializzo classe base...
if (!string.IsNullOrEmpty(getOptPar("CHANGE_ODL_MODE")))
{
CHANGE_ODL_MODE = getOptPar("CHANGE_ODL_MODE");
}
sendKeyRichiesta = true;
}
#endregion Public Constructors
#region Public Methods
/// <summary>
/// Processo i task richiesti e li elimino dalla coda 1:1
/// </summary>
/// <param name="task2exe"></param>
public override Dictionary<string, string> executeTasks(Dictionary<string, string> task2exe)
{
// uso metodo base x ora
return base.executeTasks(task2exe);
}
/// <summary>
/// Effettua vero processing contapezzi
/// </summary>
public override void processContapezzi()
{
if ((enablePzCountByApp || enablePzCountByIob) && !(disablePzCounteByIob))
{
// check condizione validazione
if (checkMultiCondition(opcUaParams.condCountEnabled) || opcUaParams.condCountEnabled.checkList.Count == 0)
{
// cerco parametro contapezzi...
string currPzCount = getDataItemValue(opcUaParams.keyPartCount);
// se ho un contapezzi... processo...
if (!string.IsNullOrEmpty(currPzCount))
{
int newVal = -1;
bool fatto = Int32.TryParse(currPzCount, out newVal);
if (fatto)
{
// gestione decremento contapezzi: viene "messo via" solo SE c'è un
// effettivo decremento contapezzi...
if (newVal < contapezziPLC)
{
pzCountResetted = true;
// incremento contatore richiesta
countKeyRichiesta = countKeyRichiesta + 1;
// log
lgInfo("Contapezzi resettato (PLC) --> pzCountResetted = true");
}
// salvo nuovo valore contapezziPLC
contapezziPLC = newVal > -1 ? newVal : contapezziPLC;
}
else
{
lgError($"Errore in decodifica valore contapezzi, valore rilevato: {currPzCount}");
}
}
else
{
lgError("Errore in decodifica valore contapezzi, valore vuoto!");
}
}
if (CHANGE_ODL_MODE == "PZCOUNT_RESET")
{
// controllo comunque, se è ZERO il contapezzi, e sul server è maggiore il
// valore x ODL e NON abilitato il trigger reset --> abilito trigger...
if (!pzCountResetted && contapezziPLC == 0 && contapezziIOB > 0)
{
pzCountResetted = true;
// incremento contatore richiesta
countKeyRichiesta = countKeyRichiesta + 1;
// log
lgInfo("Contapezzi resettato (PLC==0 e IOB>PLC) --> pzCountResetted = true");
}
}
}
}
/// <summary>
/// Effettua reset del contapezzi, NON POSSIBILE in questa versione
/// </summary>
/// <returns></returns>
public override bool resetcontapezziPLC()
{
bool answ = false;
return answ;
}
/// <summary>
/// Effettua IMPOSTAZIONE FORZATA del contapezzi, NON POSSIBILE in questa versione
/// </summary>
/// <returns></returns>
public override bool setcontapezziPLC(int newPzCount)
{
bool answ = false;
return answ;
}
#endregion Public Methods
#region Protected Fields
/// <summary>
/// Modalità cambio ODL
/// </summary>
protected string CHANGE_ODL_MODE = "";
protected bool testDone = false;
#endregion Protected Fields
#region Protected Methods
/// <summary>
/// Effettua decodifica aree memoria alla bitmap usata x MAPO
/// </summary>
protected override void decodeToBaseBitmap()
{
DateTime adesso = DateTime.Now;
// init a zero...
B_input = 0;
/* -----------------------------------------------------
* STATE MACHINE 60 STD / SIMULA
*------------------------------------------------------
* bitmap MAPO
* B0: POWER_ON
* B1: RUN
* B2: pzCount
* B3: allarme
* B4: manuale
* B5: SlowTC (NON gestito qui)
* B6: warm-up / cool-down / setup
* B7: emergenza ARMATA (1=ok, 0 = premuta)
---------------------------------------------------- */
// se valido il check ping lo eseguo... altrimenti lo do x buono
bool checkPing = !opcUaParams.pingAsPowerOn;
string currRun = "N.A.";
if (!checkPing)
{
checkPing = (testPingMachine == IPStatus.Success);
}
// bit 0 (poweron) imposto a 1 SE pingo + PowerOn=="ON"...
bool powerOnOk = checkPing && hasPowerOn;
// procedo SOLO SE mi da ping OK...
if (checkPing)
{
B_input = powerOnOk ? 1 : 0;
procRunMode(ref currRun);
#if false
// variabili RUN... se richiesto invio runMode
if (opcUaParams.runModeSend)
{
if (!string.IsNullOrEmpty(opcUaParams.keyRunMode))
{
currRun = getDataItemValue(opcUaParams.keyRunMode);
if (!string.IsNullOrEmpty(currRun))
{
// se ho valore --> invio
string sVal = "";
string descr = $"RunModeVal";
DateTime locTStamp = DateTime.Now;
sVal = $"Change: {locTStamp.ToString()} | descr: {descr} | Id: {opcUaParams.keyRunMode} | Val: {currRun}";
accodaFLog(sVal, qEncodeFLog(descr, currRun));
// se richiesto provo a tradurre
if (opcUaParams.runModeTrad)
{
string RunModeDescr = itemTranslation("RunMode", currRun);
descr = $"RunMode";
accodaFLog(sVal, qEncodeFLog(descr, RunModeDescr));
}
}
}
}
#endif
// salvo running come = working...
isRunning = isWorking;
// se ho emergenza premuta --> emergenza!
if (hasEStopArmed)
{
B_input += (1 << 7);
}
// se ho emergenza premuta --> emergenza!
if (isWarmUpCoolDown)
{
B_input += (1 << 6);
}
// se ho almeno 1 allarme E NON SONO IN AUTO --> ALARM!
if (hasError)
{
B_input += (1 << 3);
}
if (isWorking)
{
// RUN = LAVORA!
B_input += (1 << 1);
}
else if (powerOnOk && (!isReady || isManual))
{
// se NON ready --> manual
B_input += (1 << 4);
}
}
// se abilitato watchdog...
if (opcUaParams.WatchDog.IsEnabled)
{
if (adesso.Subtract(lastWatchDogPLC).TotalSeconds > 2)
{
lastWatchDogPLC = adesso;
WatchDog++;
WatchDog = WatchDog > opcUaParams.WatchDog.MaxVal ? 0 : WatchDog;
lgTrace($"WatchDog val: {WatchDog}");
try
{
WriteValue commWriteVal = new WriteValue();
commWriteVal.NodeId = new NodeId(opcUaParams.WatchDog.MemConfWrite);
commWriteVal.AttributeId = Attributes.Value;
commWriteVal.Value = new DataValue();
commWriteVal.Value.Value = WatchDog;
List<WriteValue> nodes2Write = new List<WriteValue>();
nodes2Write.Add(commWriteVal);
UA_ref.WriteNodes(nodes2Write);
}
catch (Exception exc)
{
lgError($"Eccezione in gestione WatchDog, valore attuale {WatchDog}{Environment.NewLine}{exc}");
}
}
}
else
{
lgTrace("WatchDog disabilitato");
}
// controllo se sono poweroff e se non ho dati buoni da > 2 minuti --> disconnetto
if (!powerOnOk && adesso.Subtract(lastCurrent).TotalMinutes > 2)
{
tryDisconnect();
}
// solo se non ho veto check
int vFactor = 2;
if (vetoCheckStatus < adesso)
{
lgDebug($"Stato variabili checkPing: {testPingMachine}");
// imposto veto per vetoSeconds...
vetoCheckStatus = adesso.AddSeconds(vetoSeconds * vFactor);
}
// log opzionale!
if (verboseLog)
{
lgDebug($"Trasformazione checkPing: {checkPing} | hasPowerOn: {hasPowerOn} | B_input: {B_input} | currRun = {currRun}");
}
}
/// <summary>
/// Effettua vera scrittura parametri
/// </summary>
/// <param name="updatedPar"></param>
protected override void plcWriteParams(ref List<objItem> updatedPar)
{
dataConf currMem = null;
int byteSize = 0;
string memAddrWrite = "";
string serObj = "";
if (updatedPar != null)
{
List<WriteValue> nodes2Write = new List<WriteValue>();
// controllo i parametri... ne gestisco 4...
foreach (var item in updatedPar)
{
try
{
memAddrWrite = "";
int valInt = 0;
double valReal = 0;
// cerco in area memMapWrite...
if (memMap.mMapWrite.ContainsKey(item.uid))
{
// recupero!
currMem = memMap.mMapWrite[item.uid];
byteSize = currMem.size;
memAddrWrite = currMem.memAddr;
WriteValue commWriteVal = new WriteValue();
commWriteVal.NodeId = new NodeId(currMem.memAddr);
commWriteVal.AttributeId = Attributes.Value;
commWriteVal.Value = new DataValue();
commWriteVal.Value.Value = item.reqValue;
// faccio preliminarmente upsertKey...
upsertKey(currMem.name, currMem.value);
serObj = JsonConvert.SerializeObject(item);
lgInfo($"Inizio processing plcWriteParams per {currMem.name} | valore richiesto {currMem.value}");
lgInfo($"---------------{Environment.NewLine}UPDATED PARAM:{Environment.NewLine}{serObj}{Environment.NewLine}---------------");
serObj = JsonConvert.SerializeObject(currMem);
lgInfo($"---------------{Environment.NewLine}MEMORY CONTENT:{Environment.NewLine}{serObj}{Environment.NewLine}---------------");
switch (currMem.tipoMem)
{
case plcDataType.Boolean:
break;
case plcDataType.Int:
case plcDataType.DInt:
case plcDataType.Word:
case plcDataType.DWord:
int.TryParse(item.reqValue, out valInt);
commWriteVal.Value.Value = valInt;
break;
case plcDataType.Real:
double.TryParse(item.reqValue, out valReal);
commWriteVal.Value.Value = valReal;
break;
case plcDataType.String:
commWriteVal.Value.Value = item.reqValue;
break;
default:
break;
}
lgInfo($"---------------{Environment.NewLine}OPC-UA data:{Environment.NewLine}NodeId: {commWriteVal.NodeId}{Environment.NewLine}Value: {commWriteVal.Value.Value}{Environment.NewLine}---------------");
if (!string.IsNullOrEmpty(memAddrWrite))
{
nodes2Write.Add(commWriteVal);
}
else
{
lgInfo($"Errore: memAddrWrite vuoto!");
}
}
else
{
lgInfo($"Errore uid non trovato in area write memory: {item.uid}, ci sono {memMap.mMapWrite.Count} in area write");
}
}
catch (Exception exc)
{
lgError($"Eccezione in fase di plcWriteParams per item {item.uid} con valore {item.value}{Environment.NewLine}{exc}");
}
}
if (nodes2Write.Count > 0)
{
UA_ref.WriteNodes(nodes2Write);
}
}
}
#endregion Protected Methods
}
}
+211
View File
@@ -0,0 +1,211 @@
using MapoSDK;
using Opc.Ua;
using System;
using System.Collections.Generic;
namespace IOB_WIN_NEXT
{
public class IobOpcUaMBHCimolai : IobOpcUaMBH
{
#region Public Constructors
/// <summary>
/// Estende l'init della classe base, impiegando il pacchetto Nuget OPC-UA foundation con la
/// gestione specifica per MBH (es Cimolai, Baglietto) https://github.com/OPCFoundation/UA-.NETStandard
/// </summary>
/// <param name="caller"></param>
/// <param name="IOBConf"></param>
public IobOpcUaMBHCimolai(AdapterForm caller, IobConfiguration IOBConf) : base(caller, IOBConf)
{
lgInfo("Init OpcUa MBH versione Cimolai (Baglietto)");
// inizializzo classe base...
if (!string.IsNullOrEmpty(getOptPar("CHANGE_ODL_MODE")))
{
CHANGE_ODL_MODE = getOptPar("CHANGE_ODL_MODE");
}
sendKeyRichiesta = true;
}
#endregion Public Constructors
#region Public Methods
/// <summary>
/// Processo i task richiesti e li elimino dalla coda 1:1
/// </summary>
/// <param name="task2exe"></param>
public override Dictionary<string, string> executeTasks(Dictionary<string, string> task2exe)
{
// uso metodo base x salvare esito scrittura
var writeResult = base.executeTasks(task2exe);
// aggiungo comportamento custom: se ho impostato nome ricetta (programma) --> imposto
// richiesta caricamento se ho richiesto reset o fine lavoro --> imposto azzeramento
// esco restituendo risutlato scrittura iniziali
if (task2exe != null)
{
// controllo se memMap != null...
if (memMap != null)
{
bool taskOk = false;
string taskVal = "";
// cerco task specifici x OMP
foreach (var item in task2exe)
{
taskOk = false;
taskVal = "";
// converto richiesta in enum...
taskType tName = taskType.nihil;
Enum.TryParse(item.Key, out tName);
// controllo sulla KEY...
switch (tName)
{
case taskType.setProg:
// recupero dati da memMap...
if (memMap != null && memMap.mMapWrite != null)
{
if (memMap.mMapWrite.ContainsKey(item.Key))
{
dataConf currMem = memMap.mMapWrite[item.Key];
string addr = currMem.memAddr;
taskVal = $"SET task: {item.Key} --> {item.Value} | mem: {currMem.memAddr} - {currMem.size} byte";
// salvo il nuovo valore nella memoria... così prox invio lo trasmetterà
memMap.mMapWrite[item.Key].value = item.Value;
}
else
{
taskVal = $"NO DATA MEM, SET task: {item.Key} --> {item.Value}";
}
}
else
{
taskVal = $"NO MemMap found, SET task: {item.Key} --> {item.Value}";
}
// salvo in currProd..
saveProdData(new KeyValuePair<string, string>(item.Key, item.Value));
break;
case taskType.startSetup:
setFineLotto();
break;
case taskType.stopSetup:
setInizioProd();
break;
default:
taskVal = $"taskReq: {tName} | key: {item.Key} | val: {item.Value} | SKIPPED | NO EXEC";
lgInfo($"Chiamata senza processing: taskOk: {taskOk} | taskVal: {taskVal}");
break;
}
}
}
else
{
lgError($"Attenzione! memMap è nullo, non posso eseguire task2exe!");
}
}
return writeResult;
}
/// <summary>
/// Effettua vero processing contapezzi
/// </summary>
public override void processContapezzi()
{
// non fa nulal (non ha contapezzi)
}
public override bool resetcontapezziPLC()
{
bool answ = false;
try
{
List<WriteValue> nodes2Write = new List<WriteValue>();
foreach (var item in opcUaParams.actResetCounter)
{
WriteValue commWriteVal = new WriteValue();
commWriteVal.NodeId = new NodeId(item.Key);
commWriteVal.AttributeId = Attributes.Value;
commWriteVal.Value = new DataValue();
commWriteVal.Value.Value = item.Value;
nodes2Write.Add(commWriteVal);
}
// vera scrittura
UA_ref.WriteNodes(nodes2Write);
answ = true;
}
catch
{ }
return answ;
}
#endregion Public Methods
#region Private Methods
/// <summary>
/// Azioni specifiche x indicare fine lotto di produzione
/// </summary>
/// <returns></returns>
private bool setFineLotto()
{
bool answ = false;
try
{
List<WriteValue> nodes2Write = new List<WriteValue>();
foreach (var item in opcUaParams.actStopProd)
{
WriteValue commWriteVal = new WriteValue();
commWriteVal.NodeId = new NodeId(item.Key);
commWriteVal.AttributeId = Attributes.Value;
commWriteVal.Value = new DataValue();
commWriteVal.Value.Value = item.Value;
nodes2Write.Add(commWriteVal);
}
// vera scrittura
UA_ref.WriteNodes(nodes2Write);
answ = true;
}
catch
{ }
return answ;
}
/// <summary>
/// Azioni specifiche x iniziare produzione (impostazione ricetta)
/// </summary>
/// <returns></returns>
private bool setInizioProd()
{
bool answ = false;
try
{
List<WriteValue> nodes2Write = new List<WriteValue>();
foreach (var item in opcUaParams.actSetRecipe)
{
WriteValue commWriteVal = new WriteValue();
commWriteVal.NodeId = new NodeId(item.Key);
commWriteVal.AttributeId = Attributes.Value;
commWriteVal.Value = new DataValue();
commWriteVal.Value.Value = item.Value;
nodes2Write.Add(commWriteVal);
}
// vera scrittura
UA_ref.WriteNodes(nodes2Write);
answ = true;
}
catch
{ }
return answ;
}
#endregion Private Methods
}
}
+111 -109
View File
@@ -3,26 +3,12 @@ using Newtonsoft.Json;
using Opc.Ua;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading.Tasks;
namespace IOB_WIN_NEXT
{
public class IobOpcUaOmron : IobOpcUa
{
#region Protected Fields
/// <summary>
/// Modalità cambio ODL
/// </summary>
protected string CHANGE_ODL_MODE = "";
protected bool testDone = false;
#endregion Protected Fields
#region Public Constructors
/// <summary>
@@ -43,6 +29,113 @@ namespace IOB_WIN_NEXT
#endregion Public Constructors
#region Public Methods
/// <summary>
/// Processo i task richiesti e li elimino dalla coda 1:1
/// </summary>
/// <param name="task2exe"></param>
public override Dictionary<string, string> executeTasks(Dictionary<string, string> task2exe)
{
// uso metodo base x ora
return base.executeTasks(task2exe);
}
/// <summary>
/// Effettua vero processing contapezzi
/// </summary>
public override void processContapezzi()
{
if (utils.CRB("enableContapezzi"))
{
// check condizione validazione
if (checkMultiCondition(opcUaParams.condCountEnabled) || opcUaParams.condCountEnabled.checkList.Count == 0)
{
// cerco parametro contapezzi...
string currPzCount = getDataItemValue(opcUaParams.keyPartCount);
// se ho un contapezzi... processo...
if (!string.IsNullOrEmpty(currPzCount))
{
int newVal = -1;
bool fatto = Int32.TryParse(currPzCount, out newVal);
if (fatto)
{
// gestione decremento contapezzi: viene "messo via" solo SE c'è un
// effettivo decremento contapezzi...
if (newVal < contapezziPLC)
{
pzCountResetted = true;
// incremento contatore richiesta
countKeyRichiesta = countKeyRichiesta + 1;
// log
lgInfo("Contapezzi resettato (PLC) --> pzCountResetted = true");
}
// salvo nuovo valore contapezziPLC
contapezziPLC = newVal > -1 ? newVal : contapezziPLC;
}
else
{
lgError($"Errore in decodifica valore contapezzi, valore rilevato: {currPzCount}");
}
}
else
{
lgError("Errore in decodifica valore contapezzi, valore vuoto!");
}
}
if (CHANGE_ODL_MODE == "PZCOUNT_RESET")
{
// controllo comunque, se è ZERO il contapezzi, e sul server è maggiore il
// valore x ODL e NON abilitato il trigger reset --> abilito trigger...
if (!pzCountResetted && contapezziPLC == 0 && contapezziIOB > 0)
{
pzCountResetted = true;
// incremento contatore richiesta
countKeyRichiesta = countKeyRichiesta + 1;
// log
lgInfo("Contapezzi resettato (PLC==0 e IOB>PLC) --> pzCountResetted = true");
}
}
}
}
/// <summary>
/// Effettua reset del contapezzi, NON POSSIBILE in questa versione
/// </summary>
/// <returns></returns>
public override bool resetcontapezziPLC()
{
bool answ = false;
return answ;
}
/// <summary>
/// Effettua IMPOSTAZIONE FORZATA del contapezzi, NON POSSIBILE in questa versione
/// </summary>
/// <returns></returns>
public override bool setcontapezziPLC(int newPzCount)
{
bool answ = false;
return answ;
}
#endregion Public Methods
#region Protected Fields
/// <summary>
/// Modalità cambio ODL
/// </summary>
protected string CHANGE_ODL_MODE = "";
protected bool testDone = false;
#endregion Protected Fields
#region Protected Methods
/// <summary>
@@ -82,11 +175,15 @@ namespace IOB_WIN_NEXT
{
B_input = powerOnOk ? 1 : 0;
#if false
// variabili RUN...
if (!string.IsNullOrEmpty(opcUaParams.keyRunMode))
{
currRun = getDataItemValue(opcUaParams.keyRunMode);
}
#endif
procRunMode(ref currRun);
// salvo running come = working...
isRunning = isWorking;
@@ -271,100 +368,5 @@ namespace IOB_WIN_NEXT
}
#endregion Protected Methods
#region Public Methods
/// <summary>
/// Processo i task richiesti e li elimino dalla coda 1:1
/// </summary>
/// <param name="task2exe"></param>
public override Dictionary<string, string> executeTasks(Dictionary<string, string> task2exe)
{
// uso metodo base x ora
return base.executeTasks(task2exe);
}
/// <summary>
/// Effettua vero processing contapezzi
/// </summary>
public override void processContapezzi()
{
if (utils.CRB("enableContapezzi"))
{
// check condizione validazione
if (checkMultiCondition(opcUaParams.condCountEnabled) || opcUaParams.condCountEnabled.checkList.Count == 0)
{
// cerco parametro contapezzi...
string currPzCount = getDataItemValue(opcUaParams.keyPartCount);
// se ho un contapezzi... processo...
if (!string.IsNullOrEmpty(currPzCount))
{
int newVal = -1;
bool fatto = Int32.TryParse(currPzCount, out newVal);
if (fatto)
{
// gestione decremento contapezzi: viene "messo via" solo SE c'è un effettivo decremento contapezzi...
if (newVal < contapezziPLC)
{
pzCountResetted = true;
// incremento contatore richiesta
countKeyRichiesta = countKeyRichiesta + 1;
// log
lgInfo("Contapezzi resettato (PLC) --> pzCountResetted = true");
}
// salvo nuovo valore contapezziPLC
contapezziPLC = newVal > -1 ? newVal : contapezziPLC;
}
else
{
lgError($"Errore in decodifica valore contapezzi, valore rilevato: {currPzCount}");
}
}
else
{
lgError("Errore in decodifica valore contapezzi, valore vuoto!");
}
}
if (CHANGE_ODL_MODE == "PZCOUNT_RESET")
{
// controllo comunque, se è ZERO il contapezzi, e sul server è maggiore il valore x ODL e NON abilitato il trigger reset --> abilito trigger...
if (!pzCountResetted && contapezziPLC == 0 && contapezziIOB > 0)
{
pzCountResetted = true;
// incremento contatore richiesta
countKeyRichiesta = countKeyRichiesta + 1;
// log
lgInfo("Contapezzi resettato (PLC==0 e IOB>PLC) --> pzCountResetted = true");
}
}
}
}
/// <summary>
/// Effettua reset del contapezzi, NON POSSIBILE in questa versione
/// </summary>
/// <returns></returns>
public override bool resetcontapezziPLC()
{
bool answ = false;
return answ;
}
/// <summary>
/// Effettua IMPOSTAZIONE FORZATA del contapezzi, NON POSSIBILE in questa versione
/// </summary>
/// <returns></returns>
public override bool setcontapezziPLC(int newPzCount)
{
bool answ = false;
return answ;
}
#endregion Public Methods
}
}
+2 -2
View File
@@ -427,7 +427,6 @@ namespace IOB_WIN_NEXT
{
B_input += (1 << 3);
}
}
// controllo se sono poweroff e se non ho dati buoni da > 2 minuti --> disconnetto
@@ -488,7 +487,8 @@ namespace IOB_WIN_NEXT
lgTrace($"Invio variazione dataitem per {dataItemMem.Count} elementi");
sendDataItemListToServer(startNodeId);
}
else {
else
{
lgTrace("Nessuna variazione DataItem da trasmettere");
}
}
+4
View File
@@ -176,11 +176,15 @@ namespace IOB_WIN_NEXT
{
B_input = powerOnOk ? 1 : 0;
#if false
// variabili RUN...
if (!string.IsNullOrEmpty(opcUaParams.keyRunMode))
{
currRun = getDataItemValue(opcUaParams.keyRunMode);
}
#endif
procRunMode(ref currRun);
// salvo running come = working...
isRunning = isWorking;
+12 -15
View File
@@ -1,27 +1,12 @@
using IOB_UT_NEXT;
using MapoSDK;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading.Tasks;
namespace IOB_WIN_NEXT
{
public class IobPing : IobGeneric
{
#region Protected Fields
protected int PoweroffTimeoutSec = 100;
/// <summary>
/// Veto controllo status x log...
/// </summary>
protected DateTime vetoCheckStatus = DateTime.Now;
#endregion Protected Fields
#region Public Constructors
/// <summary>
@@ -111,6 +96,7 @@ namespace IOB_WIN_NEXT
}
}
/// <summary>
/// Override connessione
/// </summary>
public override void tryConnect()
@@ -156,5 +142,16 @@ namespace IOB_WIN_NEXT
}
#endregion Public Methods
#region Protected Fields
protected int PoweroffTimeoutSec = 100;
/// <summary>
/// Veto controllo status x log...
/// </summary>
protected DateTime vetoCheckStatus = DateTime.Now;
#endregion Protected Fields
}
}
+688 -675
View File
File diff suppressed because it is too large Load Diff
+70 -69
View File
@@ -77,75 +77,6 @@ namespace IOB_WIN_NEXT
#endregion Public Constructors
#region Protected Methods
/// <summary>
/// Effettua decodifica aree memoria alla bitmap usata x MAPO
/// </summary>
protected override void decodeToBaseBitmap()
{
// init a zero...
B_input = 0;
/* -----------------------------------------------------
* bitmap MAPO STANDARD
* B0: POWER_ON
* B1: RUN
* B2: pzCount
* B3: allarme
* B4: manuale
* B5: emergenza
*
*
* - BIT di stato
* - DB60.DBX3.0: AUSILIARI INSERITI = NO EMERGENZA
* - DB60.DBX3.1: Filtro (macchina) in LAVORAZIONE
* - DB60.DBX3.2: Selettore in AUTOMATICO (sennò GIALLO)
* - DB60.DBX3.3: WARNING MIN LIV VASCA (arancio)
* - DB60.DBX3.4: WARNING MIN LIV CELLULOSA (blu)
* - DB60.DBX3.5: LAMPADA ROSSA (allarmi almeno 1 attivo)
----------------------------------------------------- */
/* -----------------------------------------------------
* bitmap MAPO FILTRO Aprochim
* B0: POWER_ON
* B1: RUN
* B2: AUTOMATICO
* B3: WARN_MIN_VASCA
* B4: WARN_MIN_CELL
* B5: ALARM
* B6: EMERGENZA
----------------------------------------------------- */
// bit 0 (poweron) imposto a 1 SE connected...
B_input = currPLC.IsConnected ? 1 : 0;
// recupero byte segnali...
int byteSignals = RawInput[3];
// aggiungo "in coda" primo bit emergenza...essendo un bit negato (NON emergenza) lo cambio di segno
if ((byteSignals & (1 << 0)) == 0)
{
byteSignals += (1 << 6);
}
// cancello primo bit (faccio uno shift a dx e poi a sx di 1...)
byteSignals = ((byteSignals >> 1) << 1);
// bit 0 (poweron) imposto a 1 SE connected...
if (currPLC.IsConnected)
{
byteSignals += (1 << 0);
}
// salvo!
B_input = byteSignals;
// log opzionale!
if (verboseLog)
{
lgInfo(string.Format($"Trasformazione dati: RawInput:{RawInput[3]} --> B_input: {B_input}"));
}
}
#endregion Protected Methods
#region Public Methods
/// <summary>
@@ -216,5 +147,75 @@ namespace IOB_WIN_NEXT
}
#endregion Public Methods
#region Protected Methods
/// <summary>
/// Effettua decodifica aree memoria alla bitmap usata x MAPO
/// </summary>
protected override void decodeToBaseBitmap()
{
// init a zero...
B_input = 0;
/* -----------------------------------------------------
* bitmap MAPO STANDARD
* B0: POWER_ON
* B1: RUN
* B2: pzCount
* B3: allarme
* B4: manuale
* B5: emergenza
*
*
* - BIT di stato
* - DB60.DBX3.0: AUSILIARI INSERITI = NO EMERGENZA
* - DB60.DBX3.1: Filtro (macchina) in LAVORAZIONE
* - DB60.DBX3.2: Selettore in AUTOMATICO (sennò GIALLO)
* - DB60.DBX3.3: WARNING MIN LIV VASCA (arancio)
* - DB60.DBX3.4: WARNING MIN LIV CELLULOSA (blu)
* - DB60.DBX3.5: LAMPADA ROSSA (allarmi almeno 1 attivo)
----------------------------------------------------- */
/* -----------------------------------------------------
* bitmap MAPO FILTRO Aprochim
* B0: POWER_ON
* B1: RUN
* B2: AUTOMATICO
* B3: WARN_MIN_VASCA
* B4: WARN_MIN_CELL
* B5: ALARM
* B6: EMERGENZA
----------------------------------------------------- */
// bit 0 (poweron) imposto a 1 SE connected...
B_input = currPLC.IsConnected ? 1 : 0;
// recupero byte segnali...
int byteSignals = RawInput[3];
// aggiungo "in coda" primo bit emergenza...essendo un bit negato (NON emergenza) lo
// cambio di segno
if ((byteSignals & (1 << 0)) == 0)
{
byteSignals += (1 << 6);
}
// cancello primo bit (faccio uno shift a dx e poi a sx di 1...)
byteSignals = ((byteSignals >> 1) << 1);
// bit 0 (poweron) imposto a 1 SE connected...
if (currPLC.IsConnected)
{
byteSignals += (1 << 0);
}
// salvo!
B_input = byteSignals;
// log opzionale!
if (verboseLog)
{
lgInfo(string.Format($"Trasformazione dati: RawInput:{RawInput[3]} --> B_input: {B_input}"));
}
}
#endregion Protected Methods
}
}
+101 -99
View File
@@ -18,14 +18,6 @@ namespace IOB_WIN_NEXT
* -------------------------------------------------------------------------------- */
#region Protected Fields
protected int counterMes2Plc = 0;
protected int counterPlc2Mes = 0;
protected DateTime lastPLCWatchDog;
#endregion Protected Fields
#region Public Constructors
/// <summary>
@@ -41,95 +33,6 @@ namespace IOB_WIN_NEXT
#endregion Public Constructors
#region Protected Methods
/// <summary>
/// Effettua decodifica aree memoria alla bitmap usata x MAPO
/// </summary>
protected override void decodeToBaseBitmap()
{
// init a zero...
B_input = 0;
/* -----------------------------------------------------
* bitmap MAPO STANDARD
* B0: POWER_ON
* B1: RUN
* B2: pzCount
* B3: allarme
* B4: manuale
* B5: avvio/spegnimento
* B6: emergenza
*
*
* - BYTE di stato
* - +0.0 AutoStatus BYTE B#16#0 Valore 0=Fermo/1->3=Avviamento/4=Avviato/5=Pausa/6->8spegnimento/9->10 allarme
* - +1.0 Dosatore BYTE B#16#0 Stato (bit0=in avviamento/1=marcia sx/2=marcia dx/3=in allarme/4=by-pass on)
* - +2.0 V_Dosatore BYTE B#16#0 Stato (bit0=in avviamento/1=marcia sx/2=marcia dx/3=in allarme/4=by-pass on)
* - +3.0 Nas_Lancio BYTE B#16#0 Stato (bit0=in avviamento/1=marcia sx/2=marcia dx/3=in allarme/4=by-pass on)
* - +4.0 Cilindro BYTE B#16#0 Stato (bit0=in avviamento/1=marcia sx/2=marcia dx/3=in allarme/4=by-pass on)
* - +5.0 Bruciatore BYTE B#16#0 Stato (bit0=in avviamento/1=marcia sx/2=marcia dx/3=in allarme/4=by-pass on)
* - +6.0 Aspiratore BYTE B#16#0 Stato (bit0=in avviamento/1=marcia sx/2=marcia dx/3=in allarme/4=by-pass on)
* - +7.0 Nas_Raccolta BYTE B#16#0 Stato (bit0=in avviamento/1=marcia sx/2=marcia dx/3=in allarme/4=by-pass on)
* - +8.0 Nas_Brandeg BYTE B#16#0 Stato (bit0=in avviamento/1=marcia sx/2=marcia dx/3=in allarme/4=by-pass on)
* - +9.0 Coclea_Filtro BYTE B#16#0 Stato (bit0=in avviamento/1=marcia sx/2=marcia dx/3=in allarme/4=by-pass on)
* - +10.0 Ciclico_Filtro BYTE B#16#0 Stato (bit0=in avviamento/1=marcia sx/2=marcia dx/3=in allarme/4=by-pass on)
----------------------------------------------------- */
// recupero byte segnali...
int byteSignals = RawInput[0];
// bit 0 (poweron) imposto a 1 SE connected...
B_input = currPLC.IsConnected ? 1 : 0;
// avviamento --> manuale
switch (byteSignals)
{
case 0:
B_input = 1;
break;
case 1:
case 2:
case 3:
B_input += (1 << 5);
break;
case 4:
B_input += (1 << 1);
break;
case 5:
B_input += (1 << 4);
break;
case 6:
case 7:
case 8:
B_input += (1 << 5);
break;
case 9:
B_input += (1 << 3);
break;
case 10:
B_input += (1 << 6);
break;
default:
break;
}
// log opzionale!
if (verboseLog)
{
lgInfo(string.Format($"Trasformazione dati: RawInput:{RawInput[0]} --> B_input: {B_input}"));
}
}
#endregion Protected Methods
#region Public Methods
/// <summary>
@@ -168,7 +71,8 @@ namespace IOB_WIN_NEXT
case taskType.forceResetPzCount:
case taskType.startSetup:
// alzo il bit x registrare richiesta reset contapezzi... POI quando ha eseguito abbassa il PLC il bit a zero...
// alzo il bit x registrare richiesta reset contapezzi... POI quando ha
// eseguito abbassa il PLC il bit a zero...
MemBlock[0] = 1;
memAddrWrite = "DB1001.DBB88";
break;
@@ -265,7 +169,8 @@ namespace IOB_WIN_NEXT
taskVal = $"WRONG REQUEST FOR SET PARAMETERS: {item.Value} doesnt contain pipe for splitting key/value";
}
}
// alzo il bit x registrare RICHEISTA modifica (secondo BIT)... POI quando ha eseguito abbassa il PLC il bit a zero...
// alzo il bit x registrare RICHEISTA modifica (secondo BIT)... POI
// quando ha eseguito abbassa il PLC il bit a zero...
MemBlock[0] = 2;
memAddrWrite = "DB1001.DBB88";
break;
@@ -349,5 +254,102 @@ namespace IOB_WIN_NEXT
}
#endregion Public Methods
#region Protected Fields
protected int counterMes2Plc = 0;
protected int counterPlc2Mes = 0;
protected DateTime lastPLCWatchDog;
#endregion Protected Fields
#region Protected Methods
/// <summary>
/// Effettua decodifica aree memoria alla bitmap usata x MAPO
/// </summary>
protected override void decodeToBaseBitmap()
{
// init a zero...
B_input = 0;
/* -----------------------------------------------------
* bitmap MAPO STANDARD
* B0: POWER_ON
* B1: RUN
* B2: pzCount
* B3: allarme
* B4: manuale
* B5: avvio/spegnimento
* B6: emergenza
*
*
* - BYTE di stato
* - +0.0 AutoStatus BYTE B#16#0 Valore 0=Fermo/1->3=Avviamento/4=Avviato/5=Pausa/6->8spegnimento/9->10 allarme
* - +1.0 Dosatore BYTE B#16#0 Stato (bit0=in avviamento/1=marcia sx/2=marcia dx/3=in allarme/4=by-pass on)
* - +2.0 V_Dosatore BYTE B#16#0 Stato (bit0=in avviamento/1=marcia sx/2=marcia dx/3=in allarme/4=by-pass on)
* - +3.0 Nas_Lancio BYTE B#16#0 Stato (bit0=in avviamento/1=marcia sx/2=marcia dx/3=in allarme/4=by-pass on)
* - +4.0 Cilindro BYTE B#16#0 Stato (bit0=in avviamento/1=marcia sx/2=marcia dx/3=in allarme/4=by-pass on)
* - +5.0 Bruciatore BYTE B#16#0 Stato (bit0=in avviamento/1=marcia sx/2=marcia dx/3=in allarme/4=by-pass on)
* - +6.0 Aspiratore BYTE B#16#0 Stato (bit0=in avviamento/1=marcia sx/2=marcia dx/3=in allarme/4=by-pass on)
* - +7.0 Nas_Raccolta BYTE B#16#0 Stato (bit0=in avviamento/1=marcia sx/2=marcia dx/3=in allarme/4=by-pass on)
* - +8.0 Nas_Brandeg BYTE B#16#0 Stato (bit0=in avviamento/1=marcia sx/2=marcia dx/3=in allarme/4=by-pass on)
* - +9.0 Coclea_Filtro BYTE B#16#0 Stato (bit0=in avviamento/1=marcia sx/2=marcia dx/3=in allarme/4=by-pass on)
* - +10.0 Ciclico_Filtro BYTE B#16#0 Stato (bit0=in avviamento/1=marcia sx/2=marcia dx/3=in allarme/4=by-pass on)
----------------------------------------------------- */
// recupero byte segnali...
int byteSignals = RawInput[0];
// bit 0 (poweron) imposto a 1 SE connected...
B_input = currPLC.IsConnected ? 1 : 0;
// avviamento --> manuale
switch (byteSignals)
{
case 0:
B_input = 1;
break;
case 1:
case 2:
case 3:
B_input += (1 << 5);
break;
case 4:
B_input += (1 << 1);
break;
case 5:
B_input += (1 << 4);
break;
case 6:
case 7:
case 8:
B_input += (1 << 5);
break;
case 9:
B_input += (1 << 3);
break;
case 10:
B_input += (1 << 6);
break;
default:
break;
}
// log opzionale!
if (verboseLog)
{
lgInfo(string.Format($"Trasformazione dati: RawInput:{RawInput[0]} --> B_input: {B_input}"));
}
}
#endregion Protected Methods
}
}
+135 -137
View File
@@ -35,12 +35,6 @@ namespace IOB_WIN_NEXT
*
* -------------------------------------------------------------------------------- */
#region Protected Fields
protected int strobeVal = 0;
#endregion Protected Fields
#region Public Constructors
/// <summary>
@@ -55,137 +49,6 @@ namespace IOB_WIN_NEXT
#endregion Public Constructors
#region Protected Properties
#if false
protected bool hasAlarms
{
get
{
bool answ = false;
int numErrors = 0;
uint currStatus = 0;
if (alarmMaps != null)
{
// leggo a ciclo le aree degli allarmi CONFIGURATI, se ne trovo --> segnalo allarme...
foreach (var item in alarmMaps)
{
// banchi in WORD (2 byte) --> scompongo
for (int i = 0; i < item.size / 2; i++)
{
currStatus = S7.Net.Types.Counter.FromByteArray(RawInput.Skip(item.index + 2 * i).Take(2).ToArray());
// verifica e decremento blink...
item.checkBlinkCounter(i, (uint)currStatus);
// verifico SE sia variato... confronto allarmi filtrato stile blink per bit status:
// - allarmi che iniziano per # IGNORATI
// - altri allarmi con un countdown da MAX_COUNTER_BLINK a 0 per il fronte di discesa
if (item.isChanged(i, currStatus))
{
if (currStatus > 0)
{
numErrors++;
}
// registro gli allarmi attivi e trasmetto...
if (sendAlarmVariations(item.memAddr, i, item.alarmsState[i], (uint)(item.alarmsMask[i] & currStatus), item.messages))
{
// se inviato --> salvo stato da current...
item.updStatusVal(i, (uint)(item.alarmsMask[i] & currStatus));
}
}
}
}
}
answ = numErrors > 0;
return answ;
}
}
#endif
#endregion Protected Properties
#region Private Methods
private void checkStrobeHack()
{
// verifico SE ho un hack sulla var DB85.DB268
byte[] byteCtrlW = new byte[2];
bool fatto = S7ReadBB(ref byteCtrlW, "DB85.DBB268", 2);
ushort valCtrlW = S7.Net.Types.Word.FromByteArray(byteCtrlW.ToArray());
// se vale 1 --> resetto strobe!
if (valCtrlW == 1)
{
// aggiunta finale bit a 0 x chiusura processing..
var MemBlock = S7.Net.Types.Int.ToByteArray(0);
var memAddrWrite = "DB85.DBB308";
// imposto valore strobe x check successivi
var taskOk = S7WriteBB(ref MemBlock, memAddrWrite);
if (taskOk)
{
strobeVal = 0;
}
}
else
{
lgInfo("SiemensComeca: Strobe attivo su DBB308, ack non rilevato su DBB268");
}
}
#endregion Private Methods
#region Protected Methods
/// <summary>
/// Effettua decodifica aree memoria alla bitmap usata x MAPO
/// - per lo scopo specifico IN REALTA' non conta lo stato macchina.... ma lo inviamo lo stesso
/// </summary>
protected override void decodeToBaseBitmap()
{
// init a zero...
B_input = 0;
/* -----------------------------------------------------
* bitmap MAPO STANDARD
* B0: POWER_ON
* B1: RUN
* B2: pzCount
* B3: allarme
*
----------------------------------------------------- */
//bool fatto = false;
//ushort valW = 0;
var MemInt = new byte[2];
int byteSignals = 0;
// bit 0 (poweron) imposto a 1 SE connected...
if (currPLC.IsConnected)
{
byteSignals += (1 << 0);
}
// processo dagli stati + gravi...
if (hasAlarms)
{
byteSignals += (1 << 3);
}
else
{
byteSignals += (1 << 1);
}
// verifico SE ho strobe/hack da chiudere
if (strobeVal != 0)
{
checkStrobeHack();
}
// salvo!
B_input = byteSignals;
}
#endregion Protected Methods
#region Public Methods
/// <summary>
@@ -278,5 +141,140 @@ namespace IOB_WIN_NEXT
}
#endregion Public Methods
#region Protected Fields
protected int strobeVal = 0;
#endregion Protected Fields
#if false
protected bool hasAlarms
{
get
{
bool answ = false;
int numErrors = 0;
uint currStatus = 0;
if (alarmMaps != null)
{
// leggo a ciclo le aree degli allarmi CONFIGURATI, se ne trovo --> segnalo allarme...
foreach (var item in alarmMaps)
{
// banchi in WORD (2 byte) --> scompongo
for (int i = 0; i < item.size / 2; i++)
{
currStatus = S7.Net.Types.Counter.FromByteArray(RawInput.Skip(item.index + 2 * i).Take(2).ToArray());
// verifica e decremento blink...
item.checkBlinkCounter(i, (uint)currStatus);
// verifico SE sia variato... confronto allarmi filtrato stile blink per
// bit status:
// - allarmi che iniziano per # IGNORATI
// - altri allarmi con un countdown da MAX_COUNTER_BLINK a 0 per il
// fronte di discesa
if (item.isChanged(i, currStatus))
{
if (currStatus > 0)
{
numErrors++;
}
// registro gli allarmi attivi e trasmetto...
if (sendAlarmVariations(item.memAddr, i, item.alarmsState[i], (uint)(item.alarmsMask[i] & currStatus), item.messages))
{
// se inviato --> salvo stato da current...
item.updStatusVal(i, (uint)(item.alarmsMask[i] & currStatus));
}
}
}
}
}
answ = numErrors > 0;
return answ;
}
}
#endif
#region Protected Methods
/// <summary>
/// Effettua decodifica aree memoria alla bitmap usata x MAPO
/// - per lo scopo specifico IN REALTA' non conta lo stato macchina.... ma lo inviamo lo stesso
/// </summary>
protected override void decodeToBaseBitmap()
{
// init a zero...
B_input = 0;
/* -----------------------------------------------------
* bitmap MAPO STANDARD
* B0: POWER_ON
* B1: RUN
* B2: pzCount
* B3: allarme
*
----------------------------------------------------- */
//bool fatto = false;
//ushort valW = 0;
var MemInt = new byte[2];
int byteSignals = 0;
// bit 0 (poweron) imposto a 1 SE connected...
if (currPLC.IsConnected)
{
byteSignals += (1 << 0);
}
// processo dagli stati + gravi...
if (hasAlarms())
{
byteSignals += (1 << 3);
}
else
{
byteSignals += (1 << 1);
}
// verifico SE ho strobe/hack da chiudere
if (strobeVal != 0)
{
checkStrobeHack();
}
// salvo!
B_input = byteSignals;
}
#endregion Protected Methods
#region Private Methods
private void checkStrobeHack()
{
// verifico SE ho un hack sulla var DB85.DB268
byte[] byteCtrlW = new byte[2];
bool fatto = S7ReadBB(ref byteCtrlW, "DB85.DBB268", 2);
ushort valCtrlW = S7.Net.Types.Word.FromByteArray(byteCtrlW.ToArray());
// se vale 1 --> resetto strobe!
if (valCtrlW == 1)
{
// aggiunta finale bit a 0 x chiusura processing..
var MemBlock = S7.Net.Types.Int.ToByteArray(0);
var memAddrWrite = "DB85.DBB308";
// imposto valore strobe x check successivi
var taskOk = S7WriteBB(ref MemBlock, memAddrWrite);
if (taskOk)
{
strobeVal = 0;
}
}
else
{
lgInfo("SiemensComeca: Strobe attivo su DBB308, ack non rilevato su DBB268");
}
}
#endregion Private Methods
}
}
+74 -74
View File
@@ -63,80 +63,6 @@ namespace IOB_WIN_NEXT
#endregion Public Constructors
#region Protected Methods
/// <summary>
/// Effettua decodifica aree memoria alla bitmap usata x MAPO
/// </summary>
protected override void decodeToBaseBitmap()
{
// init a zero...
B_input = 0;
/* -----------------------------------------------------
* bitmap MAPO STANDARD
* B0: POWER_ON
* B1: RUN
* B2: pzCount
* B3: allarme
* B4: manuale
* B5: allarme creatore
*
*
* - BIT di stato
* - DBX0.0 - Macchina On: Segnale pulito di informazione sullo stato della macchina. 0->Aux OFF, 1->Aux ON
* - DBX0.1 Macchina in Allarme: Segnale pulito di macchina in allarme. 0->Nessun Allarme, 1->E presente almeno un allarme/anomalia
* - DBX0.2 Macchina in Ciclo: Segnale pulito sullo stato di funzionamento. 0->La macchina NON sta eseguendo un ciclo automatico, 1->La macchina sta eseguendo un ciclo automatico.
* - DBX0.3 Macchina Non in Produzione: Segnale pulito sullo stato della macchina. 0->Macchina accesa e in lavorazione automatica, 1->Macchina accesa ma NON sta eseguendo un ciclo automatico.
* - DBX0.4 Macchina In Ciclo Continuità: Segnale pulito sullo stato di funzionamento. 1->La macchina sta eseguendo un ciclo automatico con carico/scarico pezzo autonomo, 0-> Altrimenti. NON HA SENSO perché NON HANNO il robot...
* - DBX0.7 Assi In Moto: Segnale pulito sullo stato di movimento Assi. 0->Tutti gli assi della macchina sono fermi, 1->Almeno un asse si sta muovendo.
* - DBX1.0 Impulso Start Ciclo: Impulso a fronte positivo (0->1) della durata di 1 che rappresenta levento di Start Ciclo.
* - DBX1.1 Impulso Fine Ciclo: Impulso a fronte positivo (0->1) della durata di 1 che rappresenta levento di Fine Ciclo. Attenzione! Questo impulso viene generato solo se il Ciclo Automatico finisce correttamente. Non viene generato nel caso in cui il Ciclo Automatico venga interrotto da allarmi.
* - DBX1.3 Impulso Conta Pezzi: Impulso a fronte positivo (0->1) della durata di 1 generato al completamento di ogni programma pezzo.
* - DBX2.0 Preallarmi Pezzi: Segnale pulito di segnalazione Preallarme Pezzi impostabile su CN. 0->Preallarme Disattivo, 1->Preallarme Attivo
* - DBX2.1 Allarme Pezzi: Segnale pulito di segnalazione Allarme Pezzi impostabile su CN. 0->Allarme Disattivo, 1->Allarme Attivo.
* - DBX2.3 Fine Vita Utensile: Segnale pulito di segnalazione Allarme Fine Vita Creatore. 0->Allarme Disattivo, 1->Allarme Attivo.
* - DBX2.7 Ciclo In Attesa: Segnale pulito sullo stato di funzionamento. 1->Ciclo Automatico attivo ma tutti assi fermi, 0->Altrimenti.
*
----------------------------------------------------- */
byte mainData = RawInput[0];
int byteSignals = 0;
// bit 0 (poweron) imposto a 1 SE connected...
if (currPLC.IsConnected)
{
byteSignals += (1 << 0);
}
if ((mainData & (1 << 2)) != 0)
{
byteSignals += (1 << 1);
}
// controllo il bit MAIN dello status
if ((mainData & (1 << 1)) != 0)
{
byteSignals += (1 << 3);
}
// considero come MANUALE NON ciclo in continuo...
if ((mainData & (1 << 3)) != 0)
{
byteSignals += (1 << 4);
}
// salvo!
B_input = byteSignals;
// log opzionale!
if (verboseLog)
{
lgInfo($"Trasformazione dati: RawInput:{RawInput[0]} --> B_input: {B_input}");
}
}
#endregion Protected Methods
#region Public Methods
/// <summary>
@@ -277,5 +203,79 @@ namespace IOB_WIN_NEXT
}
#endregion Public Methods
#region Protected Methods
/// <summary>
/// Effettua decodifica aree memoria alla bitmap usata x MAPO
/// </summary>
protected override void decodeToBaseBitmap()
{
// init a zero...
B_input = 0;
/* -----------------------------------------------------
* bitmap MAPO STANDARD
* B0: POWER_ON
* B1: RUN
* B2: pzCount
* B3: allarme
* B4: manuale
* B5: allarme creatore
*
*
* - BIT di stato
* - DBX0.0 - Macchina On: Segnale pulito di informazione sullo stato della macchina. 0->Aux OFF, 1->Aux ON
* - DBX0.1 Macchina in Allarme: Segnale pulito di macchina in allarme. 0->Nessun Allarme, 1->E presente almeno un allarme/anomalia
* - DBX0.2 Macchina in Ciclo: Segnale pulito sullo stato di funzionamento. 0->La macchina NON sta eseguendo un ciclo automatico, 1->La macchina sta eseguendo un ciclo automatico.
* - DBX0.3 Macchina Non in Produzione: Segnale pulito sullo stato della macchina. 0->Macchina accesa e in lavorazione automatica, 1->Macchina accesa ma NON sta eseguendo un ciclo automatico.
* - DBX0.4 Macchina In Ciclo Continuità: Segnale pulito sullo stato di funzionamento. 1->La macchina sta eseguendo un ciclo automatico con carico/scarico pezzo autonomo, 0-> Altrimenti. NON HA SENSO perché NON HANNO il robot...
* - DBX0.7 Assi In Moto: Segnale pulito sullo stato di movimento Assi. 0->Tutti gli assi della macchina sono fermi, 1->Almeno un asse si sta muovendo.
* - DBX1.0 Impulso Start Ciclo: Impulso a fronte positivo (0->1) della durata di 1 che rappresenta levento di Start Ciclo.
* - DBX1.1 Impulso Fine Ciclo: Impulso a fronte positivo (0->1) della durata di 1 che rappresenta levento di Fine Ciclo. Attenzione! Questo impulso viene generato solo se il Ciclo Automatico finisce correttamente. Non viene generato nel caso in cui il Ciclo Automatico venga interrotto da allarmi.
* - DBX1.3 Impulso Conta Pezzi: Impulso a fronte positivo (0->1) della durata di 1 generato al completamento di ogni programma pezzo.
* - DBX2.0 Preallarmi Pezzi: Segnale pulito di segnalazione Preallarme Pezzi impostabile su CN. 0->Preallarme Disattivo, 1->Preallarme Attivo
* - DBX2.1 Allarme Pezzi: Segnale pulito di segnalazione Allarme Pezzi impostabile su CN. 0->Allarme Disattivo, 1->Allarme Attivo.
* - DBX2.3 Fine Vita Utensile: Segnale pulito di segnalazione Allarme Fine Vita Creatore. 0->Allarme Disattivo, 1->Allarme Attivo.
* - DBX2.7 Ciclo In Attesa: Segnale pulito sullo stato di funzionamento. 1->Ciclo Automatico attivo ma tutti assi fermi, 0->Altrimenti.
*
----------------------------------------------------- */
byte mainData = RawInput[0];
int byteSignals = 0;
// bit 0 (poweron) imposto a 1 SE connected...
if (currPLC.IsConnected)
{
byteSignals += (1 << 0);
}
if ((mainData & (1 << 2)) != 0)
{
byteSignals += (1 << 1);
}
// controllo il bit MAIN dello status
if ((mainData & (1 << 1)) != 0)
{
byteSignals += (1 << 3);
}
// considero come MANUALE NON ciclo in continuo...
if ((mainData & (1 << 3)) != 0)
{
byteSignals += (1 << 4);
}
// salvo!
B_input = byteSignals;
// log opzionale!
if (verboseLog)
{
lgInfo($"Trasformazione dati: RawInput:{RawInput[0]} --> B_input: {B_input}");
}
}
#endregion Protected Methods
}
}
+82 -83
View File
@@ -3,7 +3,6 @@ using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
namespace IOB_WIN_NEXT
{
@@ -50,88 +49,6 @@ namespace IOB_WIN_NEXT
#endregion Public Constructors
#region Protected Methods
/// <summary>
/// Effettua decodifica aree memoria alla bitmap usata x MAPO
/// </summary>
protected override void decodeToBaseBitmap()
{
// init a zero...
B_input = 0;
/* -----------------------------------------------------
* bitmap MAPO STANDARD
* B0: POWER_ON
* B1: RUN
* B2: pzCount
* B3: allarme
* B4: manuale
* B5: emergenza (1=attiva/premuta, 0=armed)
*
----------------------------------------------------- */
//bool fatto = false;
ushort currStatus = 0;
ushort allarme = 0;
//ushort valW = 0;
var MemInt = new byte[2];
// recupero
//fatto = S7ReadBB(ref MemInt, "DB6.DBW204", 2);
//valW = S7.Net.Types.Word.FromByteArray(MemInt.ToArray());
//var testalW = S7.Net.Types.Word.FromByteArray(RawInput.Skip(204).Take(2).ToArray());
currStatus = S7.Net.Types.Word.FromByteArray(RawInput.Skip(204).Take(2).ToArray());
//fatto = S7ReadBB(ref MemInt, "DB6.DBW206", 2);
//valW = S7.Net.Types.Word.FromByteArray(MemInt.ToArray());
//allarme = valW;
allarme = S7.Net.Types.Word.FromByteArray(RawInput.Skip(206).Take(2).ToArray());
int byteSignals = 0;
// bit 0 (poweron) imposto a 1 SE connected...
if (currPLC.IsConnected)
{
byteSignals += (1 << 0);
}
// processo dagli stati + gravi...
if (allarme > 0)
{
byteSignals += (1 << 3);
}
switch (currStatus)
{
case 1:
byteSignals += (1 << 1);
break;
case 2:
byteSignals += (1 << 4);
break;
case 3:
byteSignals += (1 << 5);
break;
default:
break;
}
// salvo!
B_input = byteSignals;
// log opzionale!
if (verboseLog)
{
lgInfo($"Trasformazione dati: Status:{currStatus} | alarm:{allarme} --> B_input: {B_input}");
}
}
#endregion Protected Methods
#region Public Methods
/// <summary>
@@ -280,5 +197,87 @@ namespace IOB_WIN_NEXT
}
#endregion Public Methods
#region Protected Methods
/// <summary>
/// Effettua decodifica aree memoria alla bitmap usata x MAPO
/// </summary>
protected override void decodeToBaseBitmap()
{
// init a zero...
B_input = 0;
/* -----------------------------------------------------
* bitmap MAPO STANDARD
* B0: POWER_ON
* B1: RUN
* B2: pzCount
* B3: allarme
* B4: manuale
* B5: emergenza (1=attiva/premuta, 0=armed)
*
----------------------------------------------------- */
//bool fatto = false;
ushort currStatus = 0;
ushort allarme = 0;
//ushort valW = 0;
var MemInt = new byte[2];
// recupero
//fatto = S7ReadBB(ref MemInt, "DB6.DBW204", 2);
//valW = S7.Net.Types.Word.FromByteArray(MemInt.ToArray());
//var testalW = S7.Net.Types.Word.FromByteArray(RawInput.Skip(204).Take(2).ToArray());
currStatus = S7.Net.Types.Word.FromByteArray(RawInput.Skip(204).Take(2).ToArray());
//fatto = S7ReadBB(ref MemInt, "DB6.DBW206", 2);
//valW = S7.Net.Types.Word.FromByteArray(MemInt.ToArray());
//allarme = valW;
allarme = S7.Net.Types.Word.FromByteArray(RawInput.Skip(206).Take(2).ToArray());
int byteSignals = 0;
// bit 0 (poweron) imposto a 1 SE connected...
if (currPLC.IsConnected)
{
byteSignals += (1 << 0);
}
// processo dagli stati + gravi...
if (allarme > 0)
{
byteSignals += (1 << 3);
}
switch (currStatus)
{
case 1:
byteSignals += (1 << 1);
break;
case 2:
byteSignals += (1 << 4);
break;
case 3:
byteSignals += (1 << 5);
break;
default:
break;
}
// salvo!
B_input = byteSignals;
// log opzionale!
if (verboseLog)
{
lgInfo($"Trasformazione dati: Status:{currStatus} | alarm:{allarme} --> B_input: {B_input}");
}
}
#endregion Protected Methods
}
}
+25 -25
View File
@@ -95,6 +95,31 @@ namespace IOB_WIN_NEXT
#endregion Public Enums
#region Public Methods
/// <summary>
/// Recupero dati override in formato dictionary
/// </summary>
/// <returns></returns>
public override Dictionary<string, string> getDynData()
{
Dictionary<string, string> outVal = new Dictionary<string, string>();
ushort valStatus = S7.Net.Types.Word.FromByteArray(RawInput.Skip(0).Take(2).ToArray());
ushort valPosit = S7.Net.Types.Word.FromByteArray(RawInput.Skip(2).Take(2).ToArray());
outVal.Add("CURR_STATO", ((statoMacchina)valStatus).ToString());
outVal.Add("CURR_POSIT", ((posizioneSequenza)valPosit).ToString());
return outVal;
}
/// <summary>
/// Effettua processing del recupero delle OVERRIDE (spindle, feedrate, rapid)
/// </summary>
public override void processOverride()
{
}
#endregion Public Methods
#region Protected Methods
/// <summary>
@@ -263,30 +288,5 @@ namespace IOB_WIN_NEXT
}
#endregion Protected Methods
#region Public Methods
/// <summary>
/// Recupero dati override in formato dictionary
/// </summary>
/// <returns></returns>
public override Dictionary<string, string> getDynData()
{
Dictionary<string, string> outVal = new Dictionary<string, string>();
ushort valStatus = S7.Net.Types.Word.FromByteArray(RawInput.Skip(0).Take(2).ToArray());
ushort valPosit = S7.Net.Types.Word.FromByteArray(RawInput.Skip(2).Take(2).ToArray());
outVal.Add("CURR_STATO", ((statoMacchina)valStatus).ToString());
outVal.Add("CURR_POSIT", ((posizioneSequenza)valPosit).ToString());
return outVal;
}
/// <summary>
/// Effettua processing del recupero delle OVERRIDE (spindle, feedrate, rapid)
/// </summary>
public override void processOverride()
{
}
#endregion Public Methods
}
}
+82 -82
View File
@@ -58,14 +58,6 @@ namespace IOB_WIN_NEXT
*
* -------------------------------------------------------------------------------- */
#region Protected Fields
protected int counterMes2Plc = 0;
protected int counterPlc2Mes = 0;
protected DateTime lastPLCWatchDog;
#endregion Protected Fields
#region Public Constructors
/// <summary>
@@ -81,80 +73,6 @@ namespace IOB_WIN_NEXT
#endregion Public Constructors
#region Protected Methods
/// <summary>
/// Effettua decodifica aree memoria alla bitmap usata x MAPO
/// </summary>
protected override void decodeToBaseBitmap()
{
// init a zero...
B_input = 0;
/* -----------------------------------------------------
* bitmap MAPO STANDARD
* B0: POWER_ON
* B1: RUN
* B2: pzCount
* B3: allarme
* B4: manuale
* B5: emergenza
*
*
* - BIT di stato
* - DBX0.0: Macchina in LAVORAZIONE
* - DBX0.1: Macchina in CICLO
* - DBX0.2: Macchina in MANUALE
* - DBX0.3: Macchina in ALLARME
* - DBX0.4: Macchina in EMERGENZA
----------------------------------------------------- */
// bit 0 (poweron) imposto a 1 SE connected...
B_input = currPLC.IsConnected ? 1 : 0;
// recupero byte segnali...
byte mainData = RawInput[0];
int byteSignals = 0;
// bit 0 (poweron) imposto a 1 SE connected...
if (currPLC.IsConnected)
{
byteSignals += (1 << 0);
}
// RUN se lavora ed in ciclo
if ((mainData & (1 << 0)) != 0 && (mainData & (1 << 1)) != 0)
{
byteSignals += (1 << 1);
}
// manuale
if ((mainData & (1 << 2)) != 0)
{
byteSignals += (1 << 4);
}
// allarme
if ((mainData & (1 << 3)) != 0)
{
byteSignals += (1 << 3);
}
// emergenza
if ((mainData & (1 << 4)) != 0)
{
byteSignals += (1 << 5);
}
// salvo!
B_input = byteSignals;
// log opzionale!
if (verboseLog)
{
lgInfo(string.Format($"Trasformazione dati: RawInput:{RawInput[3]} --> B_input: {B_input}"));
}
}
#endregion Protected Methods
#region Public Methods
/// <summary>
@@ -299,5 +217,87 @@ namespace IOB_WIN_NEXT
}
#endregion Public Methods
#region Protected Fields
protected int counterMes2Plc = 0;
protected int counterPlc2Mes = 0;
protected DateTime lastPLCWatchDog;
#endregion Protected Fields
#region Protected Methods
/// <summary>
/// Effettua decodifica aree memoria alla bitmap usata x MAPO
/// </summary>
protected override void decodeToBaseBitmap()
{
// init a zero...
B_input = 0;
/* -----------------------------------------------------
* bitmap MAPO STANDARD
* B0: POWER_ON
* B1: RUN
* B2: pzCount
* B3: allarme
* B4: manuale
* B5: emergenza
*
*
* - BIT di stato
* - DBX0.0: Macchina in LAVORAZIONE
* - DBX0.1: Macchina in CICLO
* - DBX0.2: Macchina in MANUALE
* - DBX0.3: Macchina in ALLARME
* - DBX0.4: Macchina in EMERGENZA
----------------------------------------------------- */
// bit 0 (poweron) imposto a 1 SE connected...
B_input = currPLC.IsConnected ? 1 : 0;
// recupero byte segnali...
byte mainData = RawInput[0];
int byteSignals = 0;
// bit 0 (poweron) imposto a 1 SE connected...
if (currPLC.IsConnected)
{
byteSignals += (1 << 0);
}
// RUN se lavora ed in ciclo
if ((mainData & (1 << 0)) != 0 && (mainData & (1 << 1)) != 0)
{
byteSignals += (1 << 1);
}
// manuale
if ((mainData & (1 << 2)) != 0)
{
byteSignals += (1 << 4);
}
// allarme
if ((mainData & (1 << 3)) != 0)
{
byteSignals += (1 << 3);
}
// emergenza
if ((mainData & (1 << 4)) != 0)
{
byteSignals += (1 << 5);
}
// salvo!
B_input = byteSignals;
// log opzionale!
if (verboseLog)
{
lgInfo(string.Format($"Trasformazione dati: RawInput:{RawInput[3]} --> B_input: {B_input}"));
}
}
#endregion Protected Methods
}
}
+83 -83
View File
@@ -60,16 +60,6 @@ namespace IOB_WIN_NEXT
* -------------------------------------------------------------------------------- */
#region Protected Fields
protected int counterMes2Plc = 0;
protected int counterPlc2Mes = 0;
protected int counterPlc2MesWrote = 0;
protected DateTime lastPLCWatchDog;
protected bool useNewSend = false;
#endregion Protected Fields
#region Public Constructors
/// <summary>
@@ -118,77 +108,6 @@ namespace IOB_WIN_NEXT
#endregion Public Constructors
#region Protected Methods
/// <summary>
/// Effettua decodifica aree memoria alla bitmap usata x MAPO
/// </summary>
protected override void decodeToBaseBitmap()
{
// init a zero...
B_input = 0;
/* -----------------------------------------------------
* bitmap MAPO STANDARD
* B0: POWER_ON
* B1: RUN
* B2: pzCount
* B3: allarme
* B4: manuale
* B5: emergenza
*
*
* - BIT di stato
* - DBX0.0: RUN STATE
* - DBX0.1: CYCLE
* - DBX0.2: MANUAL MODE
* - DBX0.3: GENERAL ALARM
* - DBX0.4: ESTOP (1=OK, 0 = emergency)
* - DBX0.5: SAFETY DOORS
----------------------------------------------------- */
byte mainData = RawInput[0];
int byteSignals = 0;
// bit 0 (poweron) imposto a 1 SE connected...
if (currPLC.IsConnected)
{
byteSignals += (1 << 0);
}
if ((mainData & (1 << 0)) == 1)
{
byteSignals += (1 << 1);
}
// EMERGENZA
if ((mainData & (1 << 5)) == 1)
{
byteSignals += (1 << 5);
}
// ALLARME
if ((mainData & (1 << 3)) == 1)
{
byteSignals += (1 << 3);
}
// MANUALE ...
if ((mainData & (1 << 2)) == 1)
{
byteSignals += (1 << 4);
}
// salvo!
B_input = byteSignals;
// log opzionale!
if (verboseLog)
{
lgInfo(string.Format($"Trasformazione dati: RawInput:{RawInput[3]} --> B_input: {B_input}"));
}
}
#endregion Protected Methods
#region Public Methods
/// <summary>
@@ -561,8 +480,8 @@ namespace IOB_WIN_NEXT
public override void processWhatchDog()
{
// scrive nel primo byte, ultimo bit, il watchdog, mentre scrive nel primo 1 = setup, 0 = run
// scrivo 1 volta al secondo il contatore incrementale su area apposita
// scrive nel primo byte, ultimo bit, il watchdog, mentre scrive nel primo 1 = setup, 0
// = run scrivo 1 volta al secondo il contatore incrementale su area apposita
DateTime adesso = DateTime.Now;
if (adesso.Subtract(lastPLCWatchDog).TotalSeconds > watchDogPeriod)
{
@@ -581,5 +500,86 @@ namespace IOB_WIN_NEXT
}
#endregion Public Methods
#region Protected Fields
protected int counterMes2Plc = 0;
protected int counterPlc2Mes = 0;
protected int counterPlc2MesWrote = 0;
protected DateTime lastPLCWatchDog;
protected bool useNewSend = false;
#endregion Protected Fields
#region Protected Methods
/// <summary>
/// Effettua decodifica aree memoria alla bitmap usata x MAPO
/// </summary>
protected override void decodeToBaseBitmap()
{
// init a zero...
B_input = 0;
/* -----------------------------------------------------
* bitmap MAPO STANDARD
* B0: POWER_ON
* B1: RUN
* B2: pzCount
* B3: allarme
* B4: manuale
* B5: emergenza
*
*
* - BIT di stato
* - DBX0.0: RUN STATE
* - DBX0.1: CYCLE
* - DBX0.2: MANUAL MODE
* - DBX0.3: GENERAL ALARM
* - DBX0.4: ESTOP (1=OK, 0 = emergency)
* - DBX0.5: SAFETY DOORS
----------------------------------------------------- */
byte mainData = RawInput[0];
int byteSignals = 0;
// bit 0 (poweron) imposto a 1 SE connected...
if (currPLC.IsConnected)
{
byteSignals += (1 << 0);
}
if ((mainData & (1 << 0)) == 1)
{
byteSignals += (1 << 1);
}
// EMERGENZA
if ((mainData & (1 << 5)) == 1)
{
byteSignals += (1 << 5);
}
// ALLARME
if ((mainData & (1 << 3)) == 1)
{
byteSignals += (1 << 3);
}
// MANUALE ...
if ((mainData & (1 << 2)) == 1)
{
byteSignals += (1 << 4);
}
// salvo!
B_input = byteSignals;
// log opzionale!
if (verboseLog)
{
lgInfo(string.Format($"Trasformazione dati: RawInput:{RawInput[3]} --> B_input: {B_input}"));
}
}
#endregion Protected Methods
}
}
+65 -67
View File
@@ -1,8 +1,6 @@
using MapoSDK;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
namespace IOB_WIN_NEXT
@@ -25,12 +23,12 @@ namespace IOB_WIN_NEXT
* B00..B15 --> 16 byte di allarmi (osmosi, depurazione, 6 x filtri)
* B20..B35 --> 16 byte di stati (osmosi, depurazione, 6 x filtri)
* B40..B49 --> 5 valori uint lettura parametri
*
*
*
*
* STRUTTURA MEMORIA DB101: (scrittura) 14byte, solo 2 impiegati x ora
* NB: segnali da tenere attivi ALMENO 3 secondi x farli recepire
*
*
* B0.0 Bit Azzeramento volume acqua OSMOSI
* B0.1 Bit Azzeramento volume acqua DEPURAZIONE
*
@@ -38,12 +36,6 @@ namespace IOB_WIN_NEXT
*
* -------------------------------------------------------------------------------- */
#region Protected Fields
protected bool EmergencyBypass = false;
#endregion Protected Fields
#region Public Constructors
/// <summary>
@@ -64,59 +56,6 @@ namespace IOB_WIN_NEXT
#endregion Public Constructors
#region Protected Methods
/// <summary>
/// Effettua decodifica aree memoria alla bitmap usata x MAPO
/// </summary>
protected override void decodeToBaseBitmap()
{
// init a zero...
B_input = 0;
/* -----------------------------------------------------
* bitmap MAPO STANDARD 60
* B0: POWER_ON
* B1: RUN
* B2: pzCount - NON usato
* B3: allarme (almeno 1 presente)
* B4: manuale - non usato
* B5: slowTC - non usato
* B6: WarmUpCoolDown - no usato
* B7: Emergenza armata (1)
*
----------------------------------------------------- */
int byteSignals = 0;
// bit 0 (poweron) imposto a 1 SE connected...
if (currPLC.IsConnected)
{
byteSignals += (1 << 0);
}
// processo dagli stati + gravi...
if (hasAlarms)
{
byteSignals += (1 << 3);
}
else
{
byteSignals += (1 << 1);
}
// se bypass emergenza attivo --> forzo a ARMED...
if (EmergencyBypass)
{
// segnalo NON emergenza
byteSignals += (1 << 7);
}
// salvo!
B_input = byteSignals;
}
#endregion Protected Methods
#region Public Methods
/// <summary>
@@ -147,8 +86,8 @@ namespace IOB_WIN_NEXT
switch (tName)
{
case taskType.forceResetPzCount:
// usato x resettare i contatori osmosi inversa e depurazione
// processo scrittura BIT su DB101.DBB0 per
// usato x resettare i contatori osmosi inversa e depurazione processo
// scrittura BIT su DB101.DBB0 per
MemBlock = new byte[1];
// scrivo 3 x resettare entrambi i contatori
MemBlock = S7.Net.Types.Byte.ToByteArray(3);
@@ -162,7 +101,7 @@ namespace IOB_WIN_NEXT
break;
// lasciato commentato, da rivalutare...
// lasciato commentato, da rivalutare...
#if false
case taskType.setParameter:
// richiedo da URL i parametri WRITE da popolare
@@ -182,7 +121,7 @@ namespace IOB_WIN_NEXT
taskVal = $"WRONG REQUEST FOR SET PARAMETERS: {item.Value} doesnt contain pipe for splitting key/value";
}
}
break;
break;
#endif
default:
@@ -218,5 +157,64 @@ namespace IOB_WIN_NEXT
}
#endregion Public Methods
#region Protected Fields
protected bool EmergencyBypass = false;
#endregion Protected Fields
#region Protected Methods
/// <summary>
/// Effettua decodifica aree memoria alla bitmap usata x MAPO
/// </summary>
protected override void decodeToBaseBitmap()
{
// init a zero...
B_input = 0;
/* -----------------------------------------------------
* bitmap MAPO STANDARD 60
* B0: POWER_ON
* B1: RUN
* B2: pzCount - NON usato
* B3: allarme (almeno 1 presente)
* B4: manuale - non usato
* B5: slowTC - non usato
* B6: WarmUpCoolDown - no usato
* B7: Emergenza armata (1)
*
----------------------------------------------------- */
int byteSignals = 0;
// bit 0 (poweron) imposto a 1 SE connected...
if (currPLC.IsConnected)
{
byteSignals += (1 << 0);
}
// processo dagli stati + gravi...
if (hasAlarms())
{
byteSignals += (1 << 3);
}
else
{
byteSignals += (1 << 1);
}
// se bypass emergenza attivo --> forzo a ARMED...
if (EmergencyBypass)
{
// segnalo NON emergenza
byteSignals += (1 << 7);
}
// salvo!
B_input = byteSignals;
}
#endregion Protected Methods
}
}
+79 -79
View File
@@ -18,14 +18,6 @@ namespace IOB_WIN_NEXT
* -------------------------------------------------------------------------------- */
#region Protected Fields
protected int counterMes2Plc = 0;
protected int counterPlc2Mes = 0;
protected DateTime lastPLCWatchDog;
#endregion Protected Fields
#region Public Constructors
/// <summary>
@@ -40,77 +32,6 @@ namespace IOB_WIN_NEXT
#endregion Public Constructors
#region Protected Methods
/// <summary>
/// Effettua decodifica aree memoria alla bitmap usata x MAPO
/// </summary>
protected override void decodeToBaseBitmap()
{
// init a zero...
B_input = 0;
/* -----------------------------------------------------
* bitmap MAPO STANDARD
* B0: POWER_ON
* B1: RUN
* B2: pzCount
* B3: allarme
* B4: manuale
* B5: emergenza
*
*
* - BIT di stato
* - DBX0.0 - Life bit
* - DBX0.1 Macchina lavora
* - DBX0.2 Macchina in ciclo
* - DBX0.3 Macchina in manuale
* - DBX0.4 Macchina in allarme
* - DBX0.5 Macchina in emergenza
*
----------------------------------------------------- */
byte mainData = RawInput[0];
int byteSignals = 0;
// bit 0 (poweron) imposto a 1 SE connected...
if (currPLC.IsConnected)
{
byteSignals += (1 << 0);
}
// RUN se lavora ed in ciclo
if ((mainData & (1 << 1)) != 0 && (mainData & (1 << 2)) != 0)
{
byteSignals += (1 << 1);
}
// manuale
if ((mainData & (1 << 3)) != 0)
{
byteSignals += (1 << 4);
}
// allarme
if ((mainData & (1 << 4)) != 0)
{
byteSignals += (1 << 3);
}
// emergenza
if ((mainData & (1 << 5)) != 0)
{
byteSignals += (1 << 5);
}
// salvo!
B_input = byteSignals;
// log opzionale!
if (verboseLog)
{
lgInfo($"Trasformazione dati: RawInput:{RawInput[0]} --> B_input: {B_input}");
}
}
#endregion Protected Methods
#region Public Methods
/// <summary>
@@ -270,5 +191,84 @@ namespace IOB_WIN_NEXT
}
#endregion Public Methods
#region Protected Fields
protected int counterMes2Plc = 0;
protected int counterPlc2Mes = 0;
protected DateTime lastPLCWatchDog;
#endregion Protected Fields
#region Protected Methods
/// <summary>
/// Effettua decodifica aree memoria alla bitmap usata x MAPO
/// </summary>
protected override void decodeToBaseBitmap()
{
// init a zero...
B_input = 0;
/* -----------------------------------------------------
* bitmap MAPO STANDARD
* B0: POWER_ON
* B1: RUN
* B2: pzCount
* B3: allarme
* B4: manuale
* B5: emergenza
*
*
* - BIT di stato
* - DBX0.0 - Life bit
* - DBX0.1 Macchina lavora
* - DBX0.2 Macchina in ciclo
* - DBX0.3 Macchina in manuale
* - DBX0.4 Macchina in allarme
* - DBX0.5 Macchina in emergenza
*
----------------------------------------------------- */
byte mainData = RawInput[0];
int byteSignals = 0;
// bit 0 (poweron) imposto a 1 SE connected...
if (currPLC.IsConnected)
{
byteSignals += (1 << 0);
}
// RUN se lavora ed in ciclo
if ((mainData & (1 << 1)) != 0 && (mainData & (1 << 2)) != 0)
{
byteSignals += (1 << 1);
}
// manuale
if ((mainData & (1 << 3)) != 0)
{
byteSignals += (1 << 4);
}
// allarme
if ((mainData & (1 << 4)) != 0)
{
byteSignals += (1 << 3);
}
// emergenza
if ((mainData & (1 << 5)) != 0)
{
byteSignals += (1 << 5);
}
// salvo!
B_input = byteSignals;
// log opzionale!
if (verboseLog)
{
lgInfo($"Trasformazione dati: RawInput:{RawInput[0]} --> B_input: {B_input}");
}
}
#endregion Protected Methods
}
}
+61 -63
View File
@@ -2,8 +2,6 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
namespace IOB_WIN_NEXT
{
@@ -46,12 +44,6 @@ namespace IOB_WIN_NEXT
*
* -------------------------------------------------------------------------------- */
#region Protected Fields
protected bool EmergencyBypass = false;
#endregion Protected Fields
#region Public Constructors
/// <summary>
@@ -72,61 +64,6 @@ namespace IOB_WIN_NEXT
#endregion Public Constructors
#region Protected Methods
/// <summary>
/// Effettua decodifica aree memoria alla bitmap usata x MAPO
/// </summary>
protected override void decodeToBaseBitmap()
{
// init a zero...
B_input = 0;
/* -----------------------------------------------------
* bitmap MAPO STANDARD
* B0: POWER_ON
* B1: RUN
* B2: pzCount
* B3: allarme
* B4: manuale
* B5: MagOutPieno
* B6: MagInVuoto
* B7: Emergenza armata (1)
*
----------------------------------------------------- */
byte mainData = RawInput[0];
// copio il primo byte
int byteSignals = RawInput[0];
// bit 0 (poweron) imposto a 1 SE connected...
if (currPLC.IsConnected)
{
byteSignals |= (1 << 0);
}
else
{
byteSignals &= ~(1 << 0);
}
// se bypass emergenza attivo --> forzo a ARMED...
if (EmergencyBypass)
{
byteSignals |= (1 << 7);
}
// salvo!
B_input = byteSignals;
// log opzionale!
if (verboseLog)
{
lgInfo($"Trasformazione dati: B0: {mainData} --> B_input: {B_input}");
}
}
#endregion Protected Methods
#region Public Methods
/// <summary>
@@ -275,5 +212,66 @@ namespace IOB_WIN_NEXT
}
#endregion Public Methods
#region Protected Fields
protected bool EmergencyBypass = false;
#endregion Protected Fields
#region Protected Methods
/// <summary>
/// Effettua decodifica aree memoria alla bitmap usata x MAPO
/// </summary>
protected override void decodeToBaseBitmap()
{
// init a zero...
B_input = 0;
/* -----------------------------------------------------
* bitmap MAPO STANDARD
* B0: POWER_ON
* B1: RUN
* B2: pzCount
* B3: allarme
* B4: manuale
* B5: MagOutPieno
* B6: MagInVuoto
* B7: Emergenza armata (1)
*
----------------------------------------------------- */
byte mainData = RawInput[0];
// copio il primo byte
int byteSignals = RawInput[0];
// bit 0 (poweron) imposto a 1 SE connected...
if (currPLC.IsConnected)
{
byteSignals |= (1 << 0);
}
else
{
byteSignals &= ~(1 << 0);
}
// se bypass emergenza attivo --> forzo a ARMED...
if (EmergencyBypass)
{
byteSignals |= (1 << 7);
}
// salvo!
B_input = byteSignals;
// log opzionale!
if (verboseLog)
{
lgInfo($"Trasformazione dati: B0: {mainData} --> B_input: {B_input}");
}
}
#endregion Protected Methods
}
}
+89 -89
View File
@@ -59,15 +59,6 @@ namespace IOB_WIN_NEXT
* -------------------------------------------------------------------------------- */
#region Protected Fields
protected int counterMes2Plc = 0;
protected int counterPlc2Mes = 0;
protected int counterPlc2MesWrote = 0;
protected DateTime lastPLCWatchDog;
#endregion Protected Fields
#region Public Constructors
/// <summary>
@@ -83,86 +74,6 @@ namespace IOB_WIN_NEXT
#endregion Public Constructors
#region Protected Methods
/// <summary>
/// Effettua decodifica aree memoria alla bitmap usata x MAPO
/// </summary>
protected override void decodeToBaseBitmap()
{
// init a zero...
B_input = 0;
/* -----------------------------------------------------
* bitmap MAPO STANDARD
* B0: POWER_ON
* B1: RUN
* B2: pzCount
* B3: allarme
* B4: manuale
* B5: anomalia
*
*
* - BIT di stato
* - DBX2.0: macchina accesa
* - DBX2.1: CICLO AUTO = NON HO ANOMALIE/ALLARMI (0 --> allarme)
* - DBX2.2: contapezzi
* - DBX2.3: MACCHINA IN CICLO AUTO = LAVORA
* - DBX2.4: ERRORE tra part code MES/SAET (blu)
* - DBX2.5: Anomalia presente (rosso)
----------------------------------------------------- */
byte mainData = RawInput[2];
int byteSignals = 0;
// bit 0 (poweron) imposto a 1 SE connected...
if (currPLC.IsConnected)
{
byteSignals += (1 << 0);
}
if ((mainData & (1 << 3)) != 0)
{
byteSignals += (1 << 1);
}
// controllo il bit ALLARME
if ((mainData & (1 << 1)) == 0)
{
byteSignals += (1 << 3);
}
// controllo il bit ANOMALIA
if ((mainData & (1 << 5)) != 0)
{
byteSignals += (1 << 3);
}
// considero NON auto come manuale...
if ((mainData & (1 << 3)) == 0)
{
byteSignals += (1 << 4);
}
// salvo!
B_input = byteSignals;
// processo il watchdog!
counterPlc2Mes = S7.Net.Types.Int.FromByteArray(RawInput.Skip(0).Take(2).ToArray());
// ogni 60 registro...
if (Math.Abs(counterPlc2Mes - counterPlc2MesWrote) > 60)
{
lgInfo($"WatchDog da PLC: {counterPlc2Mes}");
counterPlc2MesWrote = counterPlc2Mes;
}
// log opzionale!
if (verboseLog)
{
lgInfo($"Trasformazione dati: RawInput:{RawInput[3]} --> B_input: {B_input}");
}
}
#endregion Protected Methods
#region Public Methods
/// <summary>
@@ -338,5 +249,94 @@ namespace IOB_WIN_NEXT
}
#endregion Public Methods
#region Protected Fields
protected int counterMes2Plc = 0;
protected int counterPlc2Mes = 0;
protected int counterPlc2MesWrote = 0;
protected DateTime lastPLCWatchDog;
#endregion Protected Fields
#region Protected Methods
/// <summary>
/// Effettua decodifica aree memoria alla bitmap usata x MAPO
/// </summary>
protected override void decodeToBaseBitmap()
{
// init a zero...
B_input = 0;
/* -----------------------------------------------------
* bitmap MAPO STANDARD
* B0: POWER_ON
* B1: RUN
* B2: pzCount
* B3: allarme
* B4: manuale
* B5: anomalia
*
*
* - BIT di stato
* - DBX2.0: macchina accesa
* - DBX2.1: CICLO AUTO = NON HO ANOMALIE/ALLARMI (0 --> allarme)
* - DBX2.2: contapezzi
* - DBX2.3: MACCHINA IN CICLO AUTO = LAVORA
* - DBX2.4: ERRORE tra part code MES/SAET (blu)
* - DBX2.5: Anomalia presente (rosso)
----------------------------------------------------- */
byte mainData = RawInput[2];
int byteSignals = 0;
// bit 0 (poweron) imposto a 1 SE connected...
if (currPLC.IsConnected)
{
byteSignals += (1 << 0);
}
if ((mainData & (1 << 3)) != 0)
{
byteSignals += (1 << 1);
}
// controllo il bit ALLARME
if ((mainData & (1 << 1)) == 0)
{
byteSignals += (1 << 3);
}
// controllo il bit ANOMALIA
if ((mainData & (1 << 5)) != 0)
{
byteSignals += (1 << 3);
}
// considero NON auto come manuale...
if ((mainData & (1 << 3)) == 0)
{
byteSignals += (1 << 4);
}
// salvo!
B_input = byteSignals;
// processo il watchdog!
counterPlc2Mes = S7.Net.Types.Int.FromByteArray(RawInput.Skip(0).Take(2).ToArray());
// ogni 60 registro...
if (Math.Abs(counterPlc2Mes - counterPlc2MesWrote) > 60)
{
lgInfo($"WatchDog da PLC: {counterPlc2Mes}");
counterPlc2MesWrote = counterPlc2Mes;
}
// log opzionale!
if (verboseLog)
{
lgInfo($"Trasformazione dati: RawInput:{RawInput[3]} --> B_input: {B_input}");
}
}
#endregion Protected Methods
}
}
+77 -76
View File
@@ -59,82 +59,6 @@ namespace IOB_WIN_NEXT
#endregion Public Constructors
#region Protected Methods
/// <summary>
/// Effettua decodifica aree memoria alla bitmap usata x MAPO
/// </summary>
protected override void decodeToBaseBitmap()
{
// init a zero...
B_input = 0;
/* -----------------------------------------------------
* bitmap MAPO STANDARD
* B0: POWER_ON
* B1: RUN
* B2: pzCount
* B3: allarme
* B4: manuale
* B5: emergenza (1=attiva/premuta, 0=armed)
*
* - BIT di stato
* DB29 blocco dati letto dal MES Byte Bit
* CicloOn Bool 0 0
* MacchOn Bool 0 1
* ManualeOn Bool 0 2
* AllarmiOn Bool 0 3
* EmergenzaOn Bool 0 4
* EmergenzaPremuta Bool 0 5
* ContapezziAssoluto DInt 2
* Comtapezzi parziale DInt 6
*
----------------------------------------------------- */
byte mainData = RawInput[0];
int byteSignals = 0;
// bit 0 (poweron) imposto a 1 SE connected...
if (currPLC.IsConnected)
{
byteSignals += (1 << 0);
}
// lavora --> bit0 e bit1: cicloOn AND macchOn
if ((mainData & (1 << 0)) != 0 && (mainData & (1 << 1)) != 0)
{
byteSignals += (1 << 1);
}
// controllo il bit ALARM
if ((mainData & (1 << 3)) != 0)
{
byteSignals += (1 << 3);
}
// controllo il bit emergenza dello status
if ((mainData & (1 << 5)) != 0)
{
byteSignals += (1 << 5);
}
// check MANUALE ...
if ((mainData & (1 << 2)) != 0)
{
byteSignals += (1 << 4);
}
// salvo!
B_input = byteSignals;
// log opzionale!
if (verboseLog)
{
lgInfo($"Trasformazione dati: RawInput:{RawInput[0]} --> B_input: {B_input}");
}
}
#endregion Protected Methods
#region Public Methods
/// <summary>
@@ -248,6 +172,7 @@ namespace IOB_WIN_NEXT
}
}
break;
default:
taskVal = "SKIPPED | NO EXEC";
break;
@@ -264,5 +189,81 @@ namespace IOB_WIN_NEXT
}
#endregion Public Methods
#region Protected Methods
/// <summary>
/// Effettua decodifica aree memoria alla bitmap usata x MAPO
/// </summary>
protected override void decodeToBaseBitmap()
{
// init a zero...
B_input = 0;
/* -----------------------------------------------------
* bitmap MAPO STANDARD
* B0: POWER_ON
* B1: RUN
* B2: pzCount
* B3: allarme
* B4: manuale
* B5: emergenza (1=attiva/premuta, 0=armed)
*
* - BIT di stato
* DB29 blocco dati letto dal MES Byte Bit
* CicloOn Bool 0 0
* MacchOn Bool 0 1
* ManualeOn Bool 0 2
* AllarmiOn Bool 0 3
* EmergenzaOn Bool 0 4
* EmergenzaPremuta Bool 0 5
* ContapezziAssoluto DInt 2
* Comtapezzi parziale DInt 6
*
----------------------------------------------------- */
byte mainData = RawInput[0];
int byteSignals = 0;
// bit 0 (poweron) imposto a 1 SE connected...
if (currPLC.IsConnected)
{
byteSignals += (1 << 0);
}
// lavora --> bit0 e bit1: cicloOn AND macchOn
if ((mainData & (1 << 0)) != 0 && (mainData & (1 << 1)) != 0)
{
byteSignals += (1 << 1);
}
// controllo il bit ALARM
if ((mainData & (1 << 3)) != 0)
{
byteSignals += (1 << 3);
}
// controllo il bit emergenza dello status
if ((mainData & (1 << 5)) != 0)
{
byteSignals += (1 << 5);
}
// check MANUALE ...
if ((mainData & (1 << 2)) != 0)
{
byteSignals += (1 << 4);
}
// salvo!
B_input = byteSignals;
// log opzionale!
if (verboseLog)
{
lgInfo($"Trasformazione dati: RawInput:{RawInput[0]} --> B_input: {B_input}");
}
}
#endregion Protected Methods
}
}
+232 -229
View File
@@ -17,12 +17,6 @@ namespace IOB_WIN_NEXT
* mod: 2019.04.06: aggiunta indicazione (IOB--> PLC) di stato setup su DB701.B0.4
* -------------------------------------------------------------------------------- */
#region Protected Fields
protected Dictionary<string, string> lastReadAlarms = new Dictionary<string, string>();
#endregion Protected Fields
#region Public Constructors
/// <summary>
@@ -38,228 +32,6 @@ namespace IOB_WIN_NEXT
#endregion Public Constructors
#region Private Methods
private int checkAlarmBank(string memAddrAlarms)
{
int trovato = 0;
uint valDW = 0;
var MemBlockPZ = new byte[4];
bool fatto = S7ReadBB(ref MemBlockPZ, memAddrAlarms, 4);
//if (fatto)
//{
valDW = S7.Net.Types.DWord.FromByteArray(MemBlockPZ.ToArray());
// se <> 0 --> log e accodo a dynData
if (valDW != 0)
{
string key = $"MTH_ALARM_{memAddrAlarms}_{valDW}";
var biteVal = baseUtils.binaryForm(valDW);
lgInfo($"Stato allarmi rilevati: {key} | {valDW} | {biteVal}");
// accodo a dictionary
string almMsg = $"{DateTime.Now} | val {valDW} | {biteVal}";
// se non ci fosse aggiungo
if (!lastReadAlarms.ContainsKey(key))
{
lastReadAlarms.Add(key, almMsg);
}
trovato++;
}
//}
return trovato;
}
private void checkAlarms()
{
// leggo i banchi allarmi : cablato D700.DBDW2 --> D700 DBDW14, sono 4 banchi a 32 bit da verificare
int trovati = 0;
// ciclo nei 4 banchi...
trovati += checkAlarmBank("DB700.DBDW2");
trovati += checkAlarmBank("DB700.DBDW6");
trovati += checkAlarmBank("DB700.DBDW10");
trovati += checkAlarmBank("DB700.DBDW14");
}
#endregion Private Methods
#region Protected Methods
/// <summary>
/// Decodifica il resto dell'area TORRI x i dati accessori (allarmi, ...)
/// </summary>
protected override void decodeOtherData()
{
if (verboseLog)
{
}
}
/// <summary>
/// Effettua decodifica aree memoria alla bitmap usata x MAPO
/// </summary>
protected override void decodeToBaseBitmap()
{
// init a zero...
B_input = 0;
// TORRI: leggo i primi 8 bit hard coded...
int byteSem = RawInput[0];
// azzero powerOn...
byteSem &= ~(1 << 0);
// bit 0 (powerOn) imposto a 1 SE connected...
if (currPLC.IsConnected)
{
byteSem += (1 << 0);
}
// azzero i bit NON gestiti (2-5-6-7)
byteSem &= ~(1 << 2);
byteSem &= ~(1 << 5);
byteSem &= ~(1 << 6);
byteSem &= ~(1 << 7);
// leggo bit DB700.B1.4 e lo porto al bit 5 --> ciclo test/accensione/spegnimento
if ((RawInput[1] & (1 << 4)) != 0) //se RawInput[1] & 16-- > 5° bit-- > TEST
{
byteSem += (1 << 5);
}
// salvo infine variabile bit x invio
B_input = byteSem;
// se ho il bit di allarme
if ((RawInput[0] & (1 << 3)) != 0)
{
checkAlarms();
}
// procedo SOLO SE è enabled IOB
if (IobOnline)
{
try
{
currODL = utils.callUrl(urlGetCurrODL);
// solo SE HO un ODL...
if (string.IsNullOrEmpty(currODL) || currODL == "0")
{
if (periodicLog)
{
lgInfo($"SiemensTorri | Lettura ODL andata a vuoto: currODL: {currODL}");
}
}
else
{
// se variato o scaduto timeout log...
if (periodicLog || (currIdxODL.ToString() != currODL))
{
lgInfo($"SiemensTorri | Lettura ODL, currODL: {currODL} --> currIdxODL prec: {currIdxODL}");
}
// provo a salvare nuovo ODL
int.TryParse(currODL, out currIdxODL);
}
}
catch (Exception exc)
{
if (DateTime.Now.Subtract(lastWarnODL).TotalSeconds > 15)
{
lgError(exc, $"Errore in fase di chiamata URL x ODL corrente | URL chiamato: {urlGetCurrODL}");
lastWarnODL = DateTime.Now;
}
}
}
else
{
// imposto currODL a vuoto!
currODL = "";
if (periodicLog)
{
lgInfo($"Fanuc | Lettura ODL non effettuata: IobOnline: {IobOnline} | currODL impostato a vuoto");
}
}
if (!string.IsNullOrEmpty(currODL) && currODL != "0")
{
// ora processo il contapezzi...
string retVal = "";
// controllo se è passato intervallo minimo tra 2 controlli/elaborazioni x distanziare invio e ridurre letture
if (DateTime.Now >= lastPzCountSend.AddMilliseconds(pzCountDelay))
{
// Salvo il contapezzi della macchina
retVal = utils.callUrlNow(urlSetPzCountMAC + contapezziPLC.ToString());
// verifica se tutto OK, ovvero conferma i pezzi inviati
if (retVal != contapezziPLC.ToString())
{
// errore salvataggio contapezzi
lgInfo($"Errore salvataggio Contapezzi PLC SIEMENST-TORRI: {contapezziPLC} | contapezziIOB {contapezziIOB} | Valore tornato: {retVal}");
// rileggo il counter pezzi da server
pzCntReload(true);
}
// se sono differenti MOSTRO...
if (contapezziPLC != contapezziIOB)
{
// registro contapezzi
lgInfo($"Differenza Contapezzi: contapezziPLC: {contapezziPLC} | contapezziIOB: {contapezziIOB}");
}
if ((contapezziPLC > contapezziIOB))
{
// salvo nuovo contapezzi (incremento di 1...) + richiesta refresh conteggio
contapezziIOB++;
needRefreshPzCount = true;
// salvo in semaforo!
B_input += 1 << 2;
// registro contapezzi
lgInfo($"contapezziPLC SIEMENST-TORRI: {contapezziPLC} | contapezziIOB {contapezziIOB}");
}
// Salvo il contapezzi della macchina
retVal = utils.callUrlNow(urlSetPzCount + contapezziIOB.ToString());
// verifica se tutto OK, ovvero conferma i pezzi inviati
if (retVal != contapezziIOB.ToString())
{
// errore salvataggio contapezzi
lgInfo($"Errore salvataggio contapezziPLC SIEMENST-TORRI: {contapezziPLC} | contapezziIOB {contapezziIOB} | Valore tornato: {retVal}");
// rileggo il counter pezzi da server
pzCntReload(true);
}
// verifico se variato contapezzi... e se passato ritardo minimo...
if ((contapezziPLC - contapezziIOB) > minSendPzCountBlock)
{
trySendPzCountBlock();
}
// invio a server contapezzi (aggiornato)
retVal = utils.callUrlNow(urlSetPzCount + contapezziIOB.ToString());
// verifica se tutto OK
if (retVal != contapezziIOB.ToString())
{
// errore salvataggio contapezzi
lgInfo($"Errore salvataggio Contapezzi SIEMENS-TORRI: contapezziPLC {contapezziPLC} | contapezziIOB {contapezziIOB} | risposta: {retVal}");
// rileggo il counter pezzi da server
pzCntReload(true);
}
// resetto timer...
lastPzCountSend = DateTime.Now;
}
}
else
{
if (DateTime.Now >= lastPzCountSend.AddMilliseconds(pzCountDelay))
{
lgInfo($"Attenzione: mancanza ODL non procedo con gestione contapezzi. contapezziPLC SIEMENST-TORRI: {contapezziPLC} | contapezziIOB: {contapezziIOB}");
// resetto timer...
lastPzCountSend = DateTime.Now;
}
}
// log opzionale!
if (verboseLog)
{
lgInfo("Trasformazione B_input: {B_input}");
}
}
#endregion Protected Methods
#region Public Methods
/// <summary>
@@ -409,7 +181,8 @@ namespace IOB_WIN_NEXT
outVal.Add("FEED_OVER", RawInput[19].ToString());
outVal.Add("RAPID_OVER", RawInput[20].ToString());
outVal.Add("CURR_MODE", decodeCurrMode(RawInput[21]));
// recupero RPM pezzo/mola !!!FARE!!! cambio nome da config, qui sono 01:conduttrice e 02:operatrice (3013), mentre sono pezzo/mola nella V100
// recupero RPM pezzo/mola !!!FARE!!! cambio nome da config, qui sono 01:conduttrice e
// 02:operatrice (3013), mentre sono pezzo/mola nella V100
valDW = S7.Net.Types.DWord.FromByteArray(RawInput.Skip(24).Take(4).ToArray());
outVal.Add("RPM_01", valDW.ToString());
valDW = S7.Net.Types.DWord.FromByteArray(RawInput.Skip(28).Take(4).ToArray());
@@ -510,5 +283,235 @@ namespace IOB_WIN_NEXT
}
#endregion Public Methods
#region Protected Fields
protected Dictionary<string, string> lastReadAlarms = new Dictionary<string, string>();
#endregion Protected Fields
#region Protected Methods
/// <summary>
/// Decodifica il resto dell'area TORRI x i dati accessori (allarmi, ...)
/// </summary>
protected override void decodeOtherData()
{
if (verboseLog)
{
}
}
/// <summary>
/// Effettua decodifica aree memoria alla bitmap usata x MAPO
/// </summary>
protected override void decodeToBaseBitmap()
{
// init a zero...
B_input = 0;
// TORRI: leggo i primi 8 bit hard coded...
int byteSem = RawInput[0];
// azzero powerOn...
byteSem &= ~(1 << 0);
// bit 0 (powerOn) imposto a 1 SE connected...
if (currPLC.IsConnected)
{
byteSem += (1 << 0);
}
// azzero i bit NON gestiti (2-5-6-7)
byteSem &= ~(1 << 2);
byteSem &= ~(1 << 5);
byteSem &= ~(1 << 6);
byteSem &= ~(1 << 7);
// leggo bit DB700.B1.4 e lo porto al bit 5 --> ciclo test/accensione/spegnimento
if ((RawInput[1] & (1 << 4)) != 0) //se RawInput[1] & 16-- > 5° bit-- > TEST
{
byteSem += (1 << 5);
}
// salvo infine variabile bit x invio
B_input = byteSem;
// se ho il bit di allarme
if ((RawInput[0] & (1 << 3)) != 0)
{
checkAlarms();
}
// procedo SOLO SE è enabled IOB
if (IobOnline)
{
try
{
currODL = utils.callUrl(urlGetCurrODL);
// solo SE HO un ODL...
if (string.IsNullOrEmpty(currODL) || currODL == "0")
{
if (periodicLog)
{
lgInfo($"SiemensTorri | Lettura ODL andata a vuoto: currODL: {currODL}");
}
}
else
{
// se variato o scaduto timeout log...
if (periodicLog || (currIdxODL.ToString() != currODL))
{
lgInfo($"SiemensTorri | Lettura ODL, currODL: {currODL} --> currIdxODL prec: {currIdxODL}");
}
// provo a salvare nuovo ODL
int.TryParse(currODL, out currIdxODL);
}
}
catch (Exception exc)
{
if (DateTime.Now.Subtract(lastWarnODL).TotalSeconds > 15)
{
lgError(exc, $"Errore in fase di chiamata URL x ODL corrente | URL chiamato: {urlGetCurrODL}");
lastWarnODL = DateTime.Now;
}
}
}
else
{
// imposto currODL a vuoto!
currODL = "";
if (periodicLog)
{
lgInfo($"Fanuc | Lettura ODL non effettuata: IobOnline: {IobOnline} | currODL impostato a vuoto");
}
}
if (!string.IsNullOrEmpty(currODL) && currODL != "0")
{
// ora processo il contapezzi...
string retVal = "";
// controllo se è passato intervallo minimo tra 2 controlli/elaborazioni x
// distanziare invio e ridurre letture
if (DateTime.Now >= lastPzCountSend.AddMilliseconds(pzCountDelay))
{
// Salvo il contapezzi della macchina
retVal = utils.callUrlNow(urlSetPzCountMAC + contapezziPLC.ToString());
// verifica se tutto OK, ovvero conferma i pezzi inviati
if (retVal != contapezziPLC.ToString())
{
// errore salvataggio contapezzi
lgInfo($"Errore salvataggio Contapezzi PLC SIEMENST-TORRI: {contapezziPLC} | contapezziIOB {contapezziIOB} | Valore tornato: {retVal}");
// rileggo il counter pezzi da server
pzCntReload(true);
}
// se sono differenti MOSTRO...
if (contapezziPLC != contapezziIOB)
{
// registro contapezzi
lgInfo($"Differenza Contapezzi: contapezziPLC: {contapezziPLC} | contapezziIOB: {contapezziIOB}");
}
if ((contapezziPLC > contapezziIOB))
{
// salvo nuovo contapezzi (incremento di 1...) + richiesta refresh conteggio
contapezziIOB++;
needRefreshPzCount = true;
// salvo in semaforo!
B_input += 1 << 2;
// registro contapezzi
lgInfo($"contapezziPLC SIEMENST-TORRI: {contapezziPLC} | contapezziIOB {contapezziIOB}");
}
// Salvo il contapezzi della macchina
retVal = utils.callUrlNow(urlSetPzCount + contapezziIOB.ToString());
// verifica se tutto OK, ovvero conferma i pezzi inviati
if (retVal != contapezziIOB.ToString())
{
// errore salvataggio contapezzi
lgInfo($"Errore salvataggio contapezziPLC SIEMENST-TORRI: {contapezziPLC} | contapezziIOB {contapezziIOB} | Valore tornato: {retVal}");
// rileggo il counter pezzi da server
pzCntReload(true);
}
// verifico se variato contapezzi... e se passato ritardo minimo...
if ((contapezziPLC - contapezziIOB) > minSendPzCountBlock)
{
trySendPzCountBlock();
}
// invio a server contapezzi (aggiornato)
retVal = utils.callUrlNow(urlSetPzCount + contapezziIOB.ToString());
// verifica se tutto OK
if (retVal != contapezziIOB.ToString())
{
// errore salvataggio contapezzi
lgInfo($"Errore salvataggio Contapezzi SIEMENS-TORRI: contapezziPLC {contapezziPLC} | contapezziIOB {contapezziIOB} | risposta: {retVal}");
// rileggo il counter pezzi da server
pzCntReload(true);
}
// resetto timer...
lastPzCountSend = DateTime.Now;
}
}
else
{
if (DateTime.Now >= lastPzCountSend.AddMilliseconds(pzCountDelay))
{
lgInfo($"Attenzione: mancanza ODL non procedo con gestione contapezzi. contapezziPLC SIEMENST-TORRI: {contapezziPLC} | contapezziIOB: {contapezziIOB}");
// resetto timer...
lastPzCountSend = DateTime.Now;
}
}
// log opzionale!
if (verboseLog)
{
lgInfo("Trasformazione B_input: {B_input}");
}
}
#endregion Protected Methods
#region Private Methods
private int checkAlarmBank(string memAddrAlarms)
{
int trovato = 0;
uint valDW = 0;
var MemBlockPZ = new byte[4];
bool fatto = S7ReadBB(ref MemBlockPZ, memAddrAlarms, 4);
//if (fatto)
//{
valDW = S7.Net.Types.DWord.FromByteArray(MemBlockPZ.ToArray());
// se <> 0 --> log e accodo a dynData
if (valDW != 0)
{
string key = $"MTH_ALARM_{memAddrAlarms}_{valDW}";
var biteVal = baseUtils.binaryForm(valDW);
lgInfo($"Stato allarmi rilevati: {key} | {valDW} | {biteVal}");
// accodo a dictionary
string almMsg = $"{DateTime.Now} | val {valDW} | {biteVal}";
// se non ci fosse aggiungo
if (!lastReadAlarms.ContainsKey(key))
{
lastReadAlarms.Add(key, almMsg);
}
trovato++;
}
//}
return trovato;
}
private void checkAlarms()
{
// leggo i banchi allarmi : cablato D700.DBDW2 --> D700 DBDW14, sono 4 banchi a 32 bit
// da verificare
int trovati = 0;
// ciclo nei 4 banchi...
trovati += checkAlarmBank("DB700.DBDW2");
trovati += checkAlarmBank("DB700.DBDW6");
trovati += checkAlarmBank("DB700.DBDW10");
trovati += checkAlarmBank("DB700.DBDW14");
}
#endregion Private Methods
}
}
+146 -145
View File
@@ -9,13 +9,13 @@ using System.Collections.Generic;
using System.IO;
using System.Net.NetworkInformation;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace IOB_WIN_NEXT
{
/// <summary>
/// Generica classe per implementare WebPageScraping (scaricamento web pages anche js-based x recupero informazioni)
/// Generica classe per implementare WebPageScraping (scaricamento web pages anche js-based x
/// recupero informazioni)
/// </summary>
public class IobWPS : IobGeneric, IDisposable
{
@@ -27,40 +27,6 @@ namespace IOB_WIN_NEXT
*
* -------------------------------------------------------------------------------- */
#region Protected Fields
/// <summary>
/// Pagina web da scaricare
/// </summary>
protected string baseUri = "http://127.0.0.1";
/// <summary>
/// Array di configurazione degli oggetti da cercare x decodifica e recupero info
/// </summary>
protected Dictionary<string, string> dataLocatorLUT;
/// <summary>
/// Driver per gestione chiamate crawling/scraping
/// </summary>
protected IWebDriver driver;
/// <summary>
/// Elementi da recuperare nella apgina web
/// </summary>
protected IWebElement element;
/// <summary>
/// Vettore della frequenza di ogni status trovato... invio ogni 100 rilevazioni (modulo 100, resto == 1)
/// </summary>
protected Dictionary<string, int> freqUnknStatus = new Dictionary<string, int>();
/// <summary>
/// Oggetti decodificati da pagina
/// </summary>
protected MonitoredItemsConf monitoredItems;
#endregion Protected Fields
#region Public Constructors
/// <summary>
@@ -76,115 +42,6 @@ namespace IOB_WIN_NEXT
#endregion Public Constructors
#region Private Methods
/// <summary>
/// Processo stati unknown...
/// </summary>
/// <param name="cKey"></param>
private void processUnknStatus(string cKey)
{
// cerco se avevo già una key nella dictionary...
if (freqUnknStatus.ContainsKey(cKey))
{
freqUnknStatus[cKey]++;
// se è 1 ogni 100 (%100, resto ==1) --> loggo...
if (freqUnknStatus[cKey] % 100 == 1)
{
lgInfo($"Errore in decodifica status: MAPPING non trovato per {cKey} | freq: {freqUnknStatus[cKey]}");
// accodo come invio di tipo FLOG...
string sVal = string.Format("[UnknStatus] {0}, freq: {1}", cKey, freqUnknStatus);
// chiamo accodamento...
accodaFLog(sVal, qEncodeFLog("UnknStatus", sVal));
}
}
else
{
// creo chiave con freq = 1
freqUnknStatus.Add(cKey, 1);
// log iniziale
lgInfo($"Errore in decodifica status: MAPPING non trovato per {cKey}");
}
}
/// <summary>
/// Ricarica conf adapter...
/// </summary>
private void reloadAdapterConf()
{
// init obj display
newDisplayData currDispData = new newDisplayData();
lgInfo("BEGIN reloadAdapterConf");
// inizializzo LUT decodifica
string jsonConf = getOptPar("LUT_CONF");
if (!string.IsNullOrEmpty(jsonConf))
{
string jsonFullPath = $"{Application.StartupPath}/DATA/CONF/{jsonConf}";
lgInfo($"Apertura file {jsonFullPath}");
StreamReader reader = new StreamReader(jsonFullPath);
string jsonData = reader.ReadToEnd();
if (!string.IsNullOrEmpty(jsonData))
{
try
{
monitoredItems = JsonConvert.DeserializeObject<MonitoredItemsConf>(jsonData);
// salvo baseUri
baseUri = monitoredItems.SrvData.baseUri;
lgInfo($"baseUri = {baseUri}");
// imposto a zero la bitmap x riavvio!
B_input = 0;
// FORZO invio dati...
accodaSigIN(ref currDispData);
// loggo!
lgInfo($"init input bitmap to zero: {B_input}");
}
catch (Exception exc)
{
lgError(exc, "Eccezione in decodifica conf json");
}
}
reader.Dispose();
}
lgInfo("DONE reloadAdapterConf");
raiseRefresh(currDispData);
}
/// <summary>
/// Avvio del WebDriver
/// </summary>
private void startDriver()
{
if (monitoredItems.SrvData.driverName == "CHROME")
{
lgInfo("Starting CHROME Driver");
// preparo opzione headless x CHROME
var o = new ChromeOptions();
o.AddArgument("headless");
ChromeDriverService service = ChromeDriverService.CreateDefaultService(Application.StartupPath);
service.HideCommandPromptWindow = true;
driver = new ChromeDriver(service, o);
}
else
{
lgInfo("Starting FIREFOX Driver");
// preparo opzione headless x FIREFOX
var o = new FirefoxOptions();
o.AddArgument("-headless");
o.SetPreference("app.update.auto", false);
o.SetPreference("app.update.enabled", false);
FirefoxDriverService service = FirefoxDriverService.CreateDefaultService(Application.StartupPath);
service.HideCommandPromptWindow = true;
driver = new FirefoxDriver(service, o);
}
// aggiungo timeout x JScripts
driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(20);
driver.Manage().Timeouts().PageLoad = TimeSpan.FromSeconds(20);
// imposto pagina di acquisizione
driver.Navigate().GoToUrl(baseUri);
}
#endregion Private Methods
#region Public Methods
public void Dispose()
@@ -387,5 +244,149 @@ namespace IOB_WIN_NEXT
}
#endregion Public Methods
#region Protected Fields
/// <summary>
/// Pagina web da scaricare
/// </summary>
protected string baseUri = "http://127.0.0.1";
/// <summary>
/// Array di configurazione degli oggetti da cercare x decodifica e recupero info
/// </summary>
protected Dictionary<string, string> dataLocatorLUT;
/// <summary>
/// Driver per gestione chiamate crawling/scraping
/// </summary>
protected IWebDriver driver;
/// <summary>
/// Elementi da recuperare nella apgina web
/// </summary>
protected IWebElement element;
/// <summary>
/// Vettore della frequenza di ogni status trovato... invio ogni 100 rilevazioni (modulo
/// 100, resto == 1)
/// </summary>
protected Dictionary<string, int> freqUnknStatus = new Dictionary<string, int>();
/// <summary>
/// Oggetti decodificati da pagina
/// </summary>
protected MonitoredItemsConf monitoredItems;
#endregion Protected Fields
#region Private Methods
/// <summary>
/// Processo stati unknown...
/// </summary>
/// <param name="cKey"></param>
private void processUnknStatus(string cKey)
{
// cerco se avevo già una key nella dictionary...
if (freqUnknStatus.ContainsKey(cKey))
{
freqUnknStatus[cKey]++;
// se è 1 ogni 100 (%100, resto ==1) --> loggo...
if (freqUnknStatus[cKey] % 100 == 1)
{
lgInfo($"Errore in decodifica status: MAPPING non trovato per {cKey} | freq: {freqUnknStatus[cKey]}");
// accodo come invio di tipo FLOG...
string sVal = string.Format("[UnknStatus] {0}, freq: {1}", cKey, freqUnknStatus);
// chiamo accodamento...
accodaFLog(sVal, qEncodeFLog("UnknStatus", sVal));
}
}
else
{
// creo chiave con freq = 1
freqUnknStatus.Add(cKey, 1);
// log iniziale
lgInfo($"Errore in decodifica status: MAPPING non trovato per {cKey}");
}
}
/// <summary>
/// Ricarica conf adapter...
/// </summary>
private void reloadAdapterConf()
{
// init obj display
newDisplayData currDispData = new newDisplayData();
lgInfo("BEGIN reloadAdapterConf");
// inizializzo LUT decodifica
string jsonConf = getOptPar("LUT_CONF");
if (!string.IsNullOrEmpty(jsonConf))
{
string jsonFullPath = $"{Application.StartupPath}/DATA/CONF/{jsonConf}";
lgInfo($"Apertura file {jsonFullPath}");
StreamReader reader = new StreamReader(jsonFullPath);
string jsonData = reader.ReadToEnd();
if (!string.IsNullOrEmpty(jsonData))
{
try
{
monitoredItems = JsonConvert.DeserializeObject<MonitoredItemsConf>(jsonData);
// salvo baseUri
baseUri = monitoredItems.SrvData.baseUri;
lgInfo($"baseUri = {baseUri}");
// imposto a zero la bitmap x riavvio!
B_input = 0;
// FORZO invio dati...
accodaSigIN(ref currDispData);
// loggo!
lgInfo($"init input bitmap to zero: {B_input}");
}
catch (Exception exc)
{
lgError(exc, "Eccezione in decodifica conf json");
}
}
reader.Dispose();
}
lgInfo("DONE reloadAdapterConf");
raiseRefresh(currDispData);
}
/// <summary>
/// Avvio del WebDriver
/// </summary>
private void startDriver()
{
if (monitoredItems.SrvData.driverName == "CHROME")
{
lgInfo("Starting CHROME Driver");
// preparo opzione headless x CHROME
var o = new ChromeOptions();
o.AddArgument("headless");
ChromeDriverService service = ChromeDriverService.CreateDefaultService(Application.StartupPath);
service.HideCommandPromptWindow = true;
driver = new ChromeDriver(service, o);
}
else
{
lgInfo("Starting FIREFOX Driver");
// preparo opzione headless x FIREFOX
var o = new FirefoxOptions();
o.AddArgument("-headless");
o.SetPreference("app.update.auto", false);
o.SetPreference("app.update.enabled", false);
FirefoxDriverService service = FirefoxDriverService.CreateDefaultService(Application.StartupPath);
service.HideCommandPromptWindow = true;
driver = new FirefoxDriver(service, o);
}
// aggiungo timeout x JScripts
driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(20);
driver.Manage().Timeouts().PageLoad = TimeSpan.FromSeconds(20);
// imposto pagina di acquisizione
driver.Navigate().GoToUrl(baseUri);
}
#endregion Private Methods
}
}
+5 -8
View File
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace IOB_WIN_NEXT
{
@@ -81,6 +78,11 @@ namespace IOB_WIN_NEXT
/// </summary>
public string nodeId { get; set; } = "";
/// <summary>
/// Valore Registrato in formato byte array
/// </summary>
public byte[] rawByte { get; set; } = new byte[1];
/// <summary>
/// Valore (in sec) del periodo di downsampling (0 --> NON usato)
/// </summary>
@@ -101,11 +103,6 @@ namespace IOB_WIN_NEXT
/// </summary>
public string value { get; set; } = "";
/// <summary>
/// Valore Registrato in formato byte array
/// </summary>
public byte[] rawByte { get; set; } = new byte[1];
/// <summary>
/// Timestamp data-ora evento registrato
/// </summary>
-4
View File
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IOB_WIN_NEXT
{
+18
View File
@@ -0,0 +1,18 @@
Per effettuare debug remoto:
1) verificare che sia presente nel server remoto il sw RemoteDebugTool
2) verificare sia avviato e configurato
3) verificare esistenza cartella C:\Steamware\IOB-WIN-NEXT-DEB\
4) impostare path di avvio come C:\Steamware\IOB-WIN-NEXT-DEB\IOB-WIN-NEXT.exe
5) impostare la remote machine con ip: porta, ad esempio sotto si trovano i aprametri x i vari clienti
6) modificare il path dello script di replica post build
7) impostare nel file di avvio la machcina corretta: DATA/CONF/MAIN.ini (in fondo, sezione [IOB] ad esempio STARTLIST=FINASSI_OMP_01)
Remote Machine conf:
Baglietto:
- 192.168.60.15:4026
Cereria Finassi:
- 10.150.0.1:4026
+130 -137
View File
@@ -1,16 +1,10 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.NetworkInformation;
using System.Threading;
using TwinCAT;
using System.Threading.Tasks;
using TwinCAT.Ads;
using TwinCAT.Ads.TypeSystem;
using System.IO;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using TwinCAT.TypeSystem;
namespace IOB_WIN_NEXT
{
@@ -20,48 +14,6 @@ namespace IOB_WIN_NEXT
public class TcAdsClient
{
#region Private Fields
/// <summary>
/// elenco delle variabili monitorate x change event
/// </summary>
private List<string> _MonitVars = new List<string>();
private int _status;
private List<int> addedSignalationList = new List<int>();
/// <summary>
/// Dizionario di conversione da indice a index group e index offset
/// </summary>
private Dictionary<int, Tuple<int, int>> addressList;
private TwinCAT.Ads.TcAdsClient adsClient;
private CancellationTokenSource cts;
private System.Threading.Tasks.Task dispatchertask;
#if false
//private Action<object> dispatcher;
private int eventHandle;
private int SegnalazioniADSEventHandle, StatusChangedEventHandle, MessageQueuedEventHandle;
private int notifyposition;
#endif
private AdsStream notifyStream;
private object lockobj = new object();
private AdsStream newNotificationStream;
private Symbol StatoMacchina;
#endregion Private Fields
#region Public Fields
public System.Collections.Concurrent.ConcurrentQueue<ComandiADS> CodaComandi;
@@ -84,9 +36,13 @@ namespace IOB_WIN_NEXT
/// <summary>
/// Inizializza un oggetto ADS x gestione classe comunicazione con TwinCat
/// </summary>
/// <param name="MonitVars">Lista dei nomi delle variabili da gestire ad eventChange (es stato macchina)</param>
/// <param name="MonitVars">
/// Lista dei nomi delle variabili da gestire ad eventChange (es stato macchina)
/// </param>
/// <param name="indirizzo">indirizzo tipo AmsNetId</param>
/// <param name="porta">Porta comunicazione: Connect to local PLC - Runtime 1 - TwinCAT2 Port=801, TwinCAT3 Port=851</param>
/// <param name="porta">
/// Porta comunicazione: Connect to local PLC - Runtime 1 - TwinCAT2 Port=801, TwinCAT3 Port=851
/// </param>
public TcAdsClient(List<string> MonitVars, string indirizzo = "local", int porta = 851)
{
_MonitVars = MonitVars;
@@ -139,7 +95,7 @@ namespace IOB_WIN_NEXT
StatoMacchina.ValueChanged += StatoMacchina_ValueChanged;
#if false
notifyposition = 0;
notifyposition = 0;
#endif
cts = new CancellationTokenSource();
@@ -213,6 +169,128 @@ namespace IOB_WIN_NEXT
#endregion Public Properties
#region Public Methods
public void dispose()
{
adsClient.Dispose();
}
public TcAdsSymbolInfo GetSymbolInfo(string nome)
{
try
{
var symbol = InfoLoader.FindSymbol(nome);
return symbol;
}
catch (Exception)
{
throw;
}
}
public object ReadVariabile(ref TcAdsSymbolInfo variabile)
{
var comando = new ComandiADS { ComandoScrittua = false, Symbol = variabile };
return ReadVariabile(comando);
}
public object ReadVariabile(string symbolName, Type type = null)
{
var comando = new ComandiADS { ComandoScrittua = false, SymbolName = symbolName };
return ReadVariabile(comando);
}
public bool WriteVariabile(string symbolName, object value, bool syncronous = false)
{
var comando = new ComandiADS { Value = value, ComandoScrittua = true, SymbolName = symbolName };
return WriteVariabile(comando, syncronous);
}
public bool WriteVariabile(TcAdsSymbolInfo symbol, object value, bool syncronous = false)
{
var comando = new ComandiADS { Value = value, ComandoScrittua = true, Symbol = symbol };
return WriteVariabile(comando, syncronous);
}
#endregion Public Methods
#region Public Classes
public class ComandiADS
{
#region Public Fields
public bool ComandoScrittua;
public bool Error;
public TcAdsSymbolInfo Symbol;
public string SymbolName;
public ManualResetEventSlim Updating;
public object Value;
#endregion Public Fields
#region Public Constructors
public ComandiADS()
{
Updating = new ManualResetEventSlim(false);
}
public ComandiADS(string name)
{
SymbolName = name;
Updating = new ManualResetEventSlim(false);
}
public ComandiADS(TcAdsSymbolInfo info)
{
Symbol = info;
Updating = new ManualResetEventSlim(false);
}
#endregion Public Constructors
}
#endregion Public Classes
#region Private Fields
/// <summary>
/// elenco delle variabili monitorate x change event
/// </summary>
private List<string> _MonitVars = new List<string>();
private int _status;
private List<int> addedSignalationList = new List<int>();
/// <summary>
/// Dizionario di conversione da indice a index group e index offset
/// </summary>
private Dictionary<int, Tuple<int, int>> addressList;
private TwinCAT.Ads.TcAdsClient adsClient;
private CancellationTokenSource cts;
private System.Threading.Tasks.Task dispatchertask;
#if false
//private Action<object> dispatcher;
private int eventHandle;
private int SegnalazioniADSEventHandle, StatusChangedEventHandle, MessageQueuedEventHandle;
private int notifyposition;
#endif
private object lockobj = new object();
private AdsStream newNotificationStream;
private AdsStream notifyStream;
private Symbol StatoMacchina;
#endregion Private Fields
#region Private Methods
private void commandDispatcher(object tk)
@@ -327,90 +405,5 @@ namespace IOB_WIN_NEXT
}
#endregion Private Methods
#region Public Methods
public void dispose()
{
adsClient.Dispose();
}
public TcAdsSymbolInfo GetSymbolInfo(string nome)
{
try
{
var symbol = InfoLoader.FindSymbol(nome);
return symbol;
}
catch (Exception)
{
throw;
}
}
public object ReadVariabile(ref TcAdsSymbolInfo variabile)
{
var comando = new ComandiADS { ComandoScrittua = false, Symbol = variabile };
return ReadVariabile(comando);
}
public object ReadVariabile(string symbolName, Type type = null)
{
var comando = new ComandiADS { ComandoScrittua = false, SymbolName = symbolName };
return ReadVariabile(comando);
}
public bool WriteVariabile(string symbolName, object value, bool syncronous = false)
{
var comando = new ComandiADS { Value = value, ComandoScrittua = true, SymbolName = symbolName };
return WriteVariabile(comando, syncronous);
}
public bool WriteVariabile(TcAdsSymbolInfo symbol, object value, bool syncronous = false)
{
var comando = new ComandiADS { Value = value, ComandoScrittua = true, Symbol = symbol };
return WriteVariabile(comando, syncronous);
}
#endregion Public Methods
#region Public Classes
public class ComandiADS
{
#region Public Fields
public bool ComandoScrittua;
public bool Error;
public TcAdsSymbolInfo Symbol;
public string SymbolName;
public ManualResetEventSlim Updating;
public object Value;
#endregion Public Fields
#region Public Constructors
public ComandiADS()
{
Updating = new ManualResetEventSlim(false);
}
public ComandiADS(string name)
{
SymbolName = name;
Updating = new ManualResetEventSlim(false);
}
public ComandiADS(TcAdsSymbolInfo info)
{
Symbol = info;
Updating = new ManualResetEventSlim(false);
}
#endregion Public Constructors
}
#endregion Public Classes
}
}
+143 -155
View File
@@ -1,12 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections;
using NLog;
using Opc.Ua;
using Opc.Ua.Client;
using NLog;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace IOB_WIN_NEXT
{
@@ -15,20 +13,6 @@ namespace IOB_WIN_NEXT
/// </summary>
public class opcUaMonitItemChange : EventArgs
{
#region Private Fields
/// <summary>
/// Monitored Item da notificare
/// </summary>
private readonly MonitoredItem _monitoredItem;
/// <summary>
/// Valore notifica
/// </summary>
private readonly MonitoredItemNotification _notification;
#endregion Private Fields
#region Public Constructors
/// <summary>
@@ -62,6 +46,20 @@ namespace IOB_WIN_NEXT
}
#endregion Public Properties
#region Private Fields
/// <summary>
/// Monitored Item da notificare
/// </summary>
private readonly MonitoredItem _monitoredItem;
/// <summary>
/// Valore notifica
/// </summary>
private readonly MonitoredItemNotification _notification;
#endregion Private Fields
}
/// <summary>
@@ -69,28 +67,6 @@ namespace IOB_WIN_NEXT
/// </summary>
public class UAClient
{
#region Private Fields
private readonly string currIob;
private readonly Action<IList, IList> m_validateResponse;
private ApplicationConfiguration m_configuration;
private Session m_session;
#endregion Private Fields
#region Protected Fields
protected static Logger lg;
protected static bool isLogVerbose = false;
/// <summary>
/// The user identity to use when creating the session.
/// </summary>
public IUserIdentity CurrUserIdentity { get; set; } = new UserIdentity();
#endregion Protected Fields
#region Public Constructors
/// <summary>
@@ -127,6 +103,11 @@ namespace IOB_WIN_NEXT
#region Public Properties
/// <summary>
/// The user identity to use when creating the session.
/// </summary>
public IUserIdentity CurrUserIdentity { get; set; } = new UserIdentity();
/// <summary>
/// Gets or sets the server URL.
/// </summary>
@@ -139,105 +120,6 @@ namespace IOB_WIN_NEXT
#endregion Public Properties
#region Private Methods
/// <summary>
/// Handles the certificate validation event.
/// This event is triggered every time an untrusted certificate is received from the server.
/// </summary>
private void CertificateValidation(CertificateValidator sender, CertificateValidationEventArgs e)
{
bool certificateAccepted = true;
// ****
// Implement a custom logic to decide if the certificate should be
// accepted or not and set certificateAccepted flag accordingly.
// The certificate can be retrieved from the e.Certificate field
// ***
ServiceResult error = e.Error;
while (error != null)
{
lgError($"{error.StatusCode} | {error.Code} | {error.LocalizedText}");
error = error.InnerResult;
}
if (certificateAccepted)
{
lgInfo($"Untrusted Certificate accepted. SubjectName = {e.Certificate.SubjectName}");
}
e.AcceptAll = certificateAccepted;
}
/// <summary>
/// Handle DataChange notifications from Server
/// </summary>
private void OnMonitoredItemNotification(MonitoredItem monitoredItem, MonitoredItemNotificationEventArgs e)
{
try
{
// Log MonitoredItem Notification event
MonitoredItemNotification notification = e.NotificationValue as MonitoredItemNotification;
// sollevo evento notifica vaziazione MonitoredItem
if (eh_MonItChange != null)
{
eh_MonItChange(this, new opcUaMonitItemChange(monitoredItem, notification));
}
lgTrace($"Notification Received | Variable: {monitoredItem.DisplayName} | Value: {notification.Value}");
}
catch (Exception ex)
{
lgError($"OnMonitoredItemNotification error: {ex.Message}");
}
}
#endregion Private Methods
#region Protected Methods
/// <summary>
/// Effettua logging ERROR corretto impostanto anche la variabile IOB prima di scrivere...
/// </summary>
/// <param name="message"></param>
protected void lgError(string message)
{
lg.Factory.Configuration.Variables["codIOB"] = currIob;
lg.Error(message);
}
/// <summary>
/// Effettua logging INFO corretto impostanto anche la variabile IOB prima di scrivere...
/// </summary>
/// <param name="message"></param>
protected void lgInfo(string message)
{
lg.Factory.Configuration.Variables["codIOB"] = currIob;
lg.Info(message);
}
/// <summary>
/// Effettua logging DEBUG corretto impostanto anche la variabile IOB prima di scrivere...
/// </summary>
/// <param name="message"></param>
protected void lgDebug(string message)
{
lg.Factory.Configuration.Variables["codIOB"] = currIob;
lg.Info(message);
}
/// <summary>
/// Effettua logging TRACE corretto impostanto anche la variabile IOB prima di scrivere...
/// </summary>
/// <param name="message"></param>
protected void lgTrace(string message)
{
lg.Factory.Configuration.Variables["codIOB"] = currIob;
lg.Trace(message);
}
#endregion Protected Methods
#region Public Methods
/// <summary>
@@ -385,14 +267,11 @@ namespace IOB_WIN_NEXT
try
{
// Define the UA Method to call
// Parent node - Objects\CTT\Methods
// Method node - Objects\CTT\Methods\Add
// Define the UA Method to call Parent node - Objects\CTT\Methods Method node - Objects\CTT\Methods\Add
NodeId objectId = new NodeId("ns=2;s=Methods");
NodeId methodId = new NodeId("ns=2;s=Methods_Add");
// Define the method parameters
// Input argument requires a Float and an UInt32 value
// Define the method parameters Input argument requires a Float and an UInt32 value
object[] inputArguments = new object[] { (float)10.5, (uint)10 };
IList<object> outputArguments = null;
@@ -429,8 +308,8 @@ namespace IOB_WIN_NEXT
{
lgInfo("Connecting...");
// Get the endpoint by connecting to server's discovery endpoint.
// Try to find the first endopint without security.
// Get the endpoint by connecting to server's discovery endpoint. Try to find
// the first endopint without security.
EndpointDescription endpointDescription = CoreClientUtils.SelectEndpoint(ServerUrl, false);
EndpointConfiguration endpointConfiguration = EndpointConfiguration.Create(m_configuration);
@@ -573,7 +452,6 @@ namespace IOB_WIN_NEXT
return answ;
}
/// <summary>
/// Read a SINGLE of nodes value (RAW) from Server
/// </summary>
@@ -590,7 +468,6 @@ namespace IOB_WIN_NEXT
try
{
#region Read the Value attribute of a node by calling the Session.ReadValue method
try
@@ -614,8 +491,6 @@ namespace IOB_WIN_NEXT
return answ;
}
/// <summary>
/// Read a list of nodes from Server
/// </summary>
@@ -813,8 +688,7 @@ namespace IOB_WIN_NEXT
return monItList;
}
/// Write a list of nodes to the Server
/// </summary>
/// Write a list of nodes to the Server </summary>
public void WriteNodes(List<WriteValue> node2Write)
{
if (m_session == null || m_session.Connected == false)
@@ -1002,5 +876,119 @@ namespace IOB_WIN_NEXT
}
#endregion Public Methods
#region Protected Fields
protected static bool isLogVerbose = false;
protected static Logger lg;
#endregion Protected Fields
#region Protected Methods
/// <summary>
/// Effettua logging DEBUG corretto impostanto anche la variabile IOB prima di scrivere...
/// </summary>
/// <param name="message"></param>
protected void lgDebug(string message)
{
lg.Factory.Configuration.Variables["codIOB"] = currIob;
lg.Info(message);
}
/// <summary>
/// Effettua logging ERROR corretto impostanto anche la variabile IOB prima di scrivere...
/// </summary>
/// <param name="message"></param>
protected void lgError(string message)
{
lg.Factory.Configuration.Variables["codIOB"] = currIob;
lg.Error(message);
}
/// <summary>
/// Effettua logging INFO corretto impostanto anche la variabile IOB prima di scrivere...
/// </summary>
/// <param name="message"></param>
protected void lgInfo(string message)
{
lg.Factory.Configuration.Variables["codIOB"] = currIob;
lg.Info(message);
}
/// <summary>
/// Effettua logging TRACE corretto impostanto anche la variabile IOB prima di scrivere...
/// </summary>
/// <param name="message"></param>
protected void lgTrace(string message)
{
lg.Factory.Configuration.Variables["codIOB"] = currIob;
lg.Trace(message);
}
#endregion Protected Methods
#region Private Fields
private readonly string currIob;
private readonly Action<IList, IList> m_validateResponse;
private ApplicationConfiguration m_configuration;
private Session m_session;
#endregion Private Fields
#region Private Methods
/// <summary>
/// Handles the certificate validation event. This event is triggered every time an
/// untrusted certificate is received from the server.
/// </summary>
private void CertificateValidation(CertificateValidator sender, CertificateValidationEventArgs e)
{
bool certificateAccepted = true;
// **** Implement a custom logic to decide if the certificate should be accepted or not
// and set certificateAccepted flag accordingly. The certificate can be retrieved from
// the e.Certificate field ***
ServiceResult error = e.Error;
while (error != null)
{
lgError($"{error.StatusCode} | {error.Code} | {error.LocalizedText}");
error = error.InnerResult;
}
if (certificateAccepted)
{
lgInfo($"Untrusted Certificate accepted. SubjectName = {e.Certificate.SubjectName}");
}
e.AcceptAll = certificateAccepted;
}
/// <summary>
/// Handle DataChange notifications from Server
/// </summary>
private void OnMonitoredItemNotification(MonitoredItem monitoredItem, MonitoredItemNotificationEventArgs e)
{
try
{
// Log MonitoredItem Notification event
MonitoredItemNotification notification = e.NotificationValue as MonitoredItemNotification;
// sollevo evento notifica vaziazione MonitoredItem
if (eh_MonItChange != null)
{
eh_MonItChange(this, new opcUaMonitItemChange(monitoredItem, notification));
}
lgTrace($"Notification Received | Variable: {monitoredItem.DisplayName} | Value: {notification.Value}");
}
catch (Exception ex)
{
lgError($"OnMonitoredItemNotification error: {ex.Message}");
}
}
#endregion Private Methods
}
}
-5
View File
@@ -1,9 +1,4 @@
using EgwProxy.MultiCncLib.CNC;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IOB_WIN_NEXT
{
+1 -1
View File
@@ -6,7 +6,7 @@
<package id="EgwProxy.MultiCncLib" version="3.6.2207.1211" targetFramework="net462" />
<package id="EgwProxy.OsaiCncLib" version="3.6.2205.2015" targetFramework="net462" />
<package id="EntityFramework" version="6.4.4" targetFramework="net462" />
<package id="MapoSDK" version="6.14.2207.2913" targetFramework="net462" />
<package id="MapoSDK" version="6.14.2209.916" targetFramework="net462" />
<package id="MathNet.Numerics" version="4.15.0" targetFramework="net462" />
<package id="Microsoft.CodeAnalysis.NetAnalyzers" version="6.0.0" targetFramework="net462" developmentDependency="true" />
<package id="Microsoft.VisualStudio.SlowCheetah" version="4.0.8" targetFramework="net462" developmentDependency="true" />
+5 -2
View File
@@ -53,10 +53,13 @@ goto END
:RemoteDebug
echo Debug remoto: effettuo robocopy sync
REM copia script verso server remoto
REM echo Debug remoto: effettuo robocopy sync (verificare remote per cliente)
REM copia script verso server remoto (FINASSI)
REM FINASSI
ROBOCOPY . \\10.150.0.1\Steamware\IOB-WIN-NEXT-DEB /MIR
REM Baglietto
REM ROBOCOPY . \\192.168.60.15\Steamware\IOB-WIN-NEXT-DEB /MIR
goto END
+7 -7
View File
@@ -10,6 +10,11 @@ namespace IOB_WIN_NEXT
{
#region Public Fields
/// <summary>
/// Indirizzo di base degli Holding Register
/// </summary>
public int holdRegBaseAddr = 40001;
/// <summary>
/// Indirizzo IP del PLC
/// </summary>
@@ -40,11 +45,6 @@ namespace IOB_WIN_NEXT
/// </summary>
public int pingMsTimeout = 250;
/// <summary>
/// Indirizzo di base degli Holding Register
/// </summary>
public int holdRegBaseAddr= 40001;
/// <summary>
/// Porta di comunicazione
/// </summary>
@@ -54,8 +54,8 @@ namespace IOB_WIN_NEXT
}
/// <summary>
/// Implementazione classe connessione SIEMENS con S7.net,
/// comprensiva dei parametri delle aree di memoria
/// Implementazione classe connessione SIEMENS con S7.net, comprensiva dei parametri delle aree
/// di memoria
/// </summary>
public class connParamS7
{
@@ -0,0 +1,702 @@
[
{
"description": "profinet Byte_B0",
"tipoMem": "Byte",
"memAddr": "All_Byte_B0",
"index": 0,
"size": 1,
"messages": [
"Allarme comunicazione profinet - I/O GT2",
"Allarme comunicazione profinet - Sistema di pesatura",
"Allarme comunicazione - Ricevente radiocomando",
"Allarme comunicazione CanOpen - Motore GT1",
"Allarme comunicazione CanOpen - Motore GT2",
"##",
"##",
"##"
]
},
{
"description": "profinet Byte_B1",
"tipoMem": "Byte",
"memAddr": "All_Byte_B1",
"index": 1,
"size": 1,
"messages": [
"Allarme comunicazione profinet - Modulo IOlink 1(TU) {A190.1}",
"Allarme comunicazione profinet - Modulo IOlink 2(TU) {A190.2}",
"Allarme comunicazione profinet - Modulo IOlink 3(TU) {A190.3}",
"Allarme comunicazione profinet - Modulo IOlink 1(LB) {A206.1}",
"Allarme comunicazione profinet - Modulo IOlink 2(LB) {A206.2}",
"Allarme comunicazione profinet - Modulo IOlink 3(LB) {A206.3}",
"Allarme comunicazione profinet - Modulo IOlink 6(LB) {A206.6}",
"Allarme comunicazione profinet - Modulo IOlink 1(UB) {A231.1}"
]
},
{
"description": "profinet Byte_B2",
"tipoMem": "Byte",
"memAddr": "All_Byte_B2",
"index": 2,
"size": 1,
"messages": [
"Allarme comunicazione profinet - Modulo IOlink 1.1(TU) {A690.1}",
"Allarme comunicazione profinet - Modulo IOlink 2.1(TU) {A690.2}",
"Allarme comunicazione profinet - Modulo IOlink 3.1(TU) {A690.3}",
"Allarme comunicazione profinet - Modulo IOlink 1.1(LB) {A706.1}",
"Allarme comunicazione profinet - Modulo IOlink 2.1(LB) {A706.2}",
"Allarme comunicazione profinet - Modulo IOlink 3.1(LB) {A706.3}",
"Allarme comunicazione profinet - Modulo IOlink 6.1(LB) {A706.6}",
"Allarme comunicazione profinet - Modulo IOlink 1.1(UB) {A731.1}"
]
},
{
"description": "profinet Byte_B3",
"tipoMem": "Byte",
"memAddr": "All_Byte_B3",
"index": 3,
"size": 1,
"messages": [
"Allarme comunicazione profinet - Encoder ruota 1 sinistra",
"Allarme comunicazione profinet - Encoder ruota 2 sinistra",
"Allarme comunicazione profinet - Encoder ruota 3 sinistra",
"Allarme comunicazione profinet - Encoder ruota 4 sinistra",
"Allarme comunicazione profinet - Encoder ruota 5 sinistra",
"Allarme comunicazione profinet - Encoder ruota 6 sinistra",
"Allarme comunicazione profinet - Encoder ruota 7 sinistra",
"Allarme comunicazione profinet - Encoder ruota 8 sinistra"
]
},
{
"description": "profinet Byte_B4",
"tipoMem": "Byte",
"memAddr": "All_Byte_B4",
"index": 4,
"size": 1,
"messages": [
"Allarme comunicazione profinet - Encoder ruota 1 destra",
"Allarme comunicazione profinet - Encoder ruota 2 destra",
"Allarme comunicazione profinet - Encoder ruota 3 destra",
"Allarme comunicazione profinet - Encoder ruota 4 destra",
"Allarme comunicazione profinet - Encoder ruota 5 destra",
"Allarme comunicazione profinet - Encoder ruota 6 destra",
"Allarme comunicazione profinet - Encoder ruota 7 destra",
"Allarme comunicazione profinet - Encoder ruota 8 destra"
]
},
{
"description": "profinet Byte_B5",
"tipoMem": "Byte",
"memAddr": "All_Byte_B5",
"index": 5,
"size": 1,
"messages": [
"Allarme comunicazione profinet - encoder carrello 1",
"Allarme comunicazione profinet - encoder carrello 2",
"Allarme comunicazione profinet - encoder carrello 3",
"Allarme comunicazione profinet - encoder carrello 4",
"Allarme comunicazione profinet - encoder carrello 5",
"Allarme comunicazione profinet - encoder carrello 6",
"Allarme comunicazione profinet - encoder carrello 7",
"Allarme comunicazione profinet - encoder carrello 8"
]
},
{
"description": "profinet Byte_B6",
"tipoMem": "Byte",
"memAddr": "All_Byte_B6",
"index": 6,
"size": 1,
"messages": [
"Allarme comunicazione profinet - encoder argano 1",
"Allarme comunicazione profinet - encoder argano 2",
"Allarme comunicazione profinet - encoder argano 3",
"Allarme comunicazione profinet - encoder argano 4",
"Allarme comunicazione profinet - encoder argano 5",
"Allarme comunicazione profinet - encoder argano 6",
"Allarme comunicazione profinet - encoder argano 7",
"Allarme comunicazione profinet - encoder argano 8"
]
},
{
"description": "message Byte_B7",
"tipoMem": "Byte",
"memAddr": "All_Byte_B7",
"index": 7,
"size": 1,
"messages": [
"Pulsante emergenza premuto su ruota 1 SX",
"Pulsante emergenza premuto su ruota 2 SX",
"Pulsante emergenza premuto su ruota 3 SX",
"Pulsante emergenza premuto su ruota 4 SX",
"Pulsante emergenza premuto su ruota 5 SX",
"Pulsante emergenza premuto su ruota 6 SX",
"Pulsante emergenza premuto su ruota 7 SX",
"Pulsante emergenza premuto su ruota 8 SX"
]
},
{
"description": "message Byte_B8",
"tipoMem": "Byte",
"memAddr": "All_Byte_B8",
"index": 8,
"size": 1,
"messages": [
"Pulsante emergenza premuto su ruota 1 DX",
"Pulsante emergenza premuto su ruota 2 DX",
"Pulsante emergenza premuto su ruota 3 DX",
"Pulsante emergenza premuto su ruota 4 DX",
"Pulsante emergenza premuto su ruota 5 DX",
"Pulsante emergenza premuto su ruota 6 DX",
"Pulsante emergenza premuto su ruota 7 DX",
"Pulsante emergenza premuto su ruota 8 DX"
]
},
{
"description": "message Byte_B9",
"tipoMem": "Byte",
"memAddr": "All_Byte_B9",
"index": 9,
"size": 1,
"messages": [
"Pulsante emergenza premuto su QE GT1",
"Pulsante emergenza premuto su QE GT2",
"Radiocomando spento o fungo di emergenza premuto",
"##",
"##",
"##",
"##",
"##"
]
},
{
"description": "hydraulic Byte_B10",
"tipoMem": "Byte",
"memAddr": "All_Byte_B10",
"index": 10,
"size": 1,
"messages": [
"Filtro Intasato 1 - GT1",
"Filtro Intasato 2 - GT1",
"Filtro Intasato 3 - GT1",
"Filtro Intasato 4 - GT1",
"Filtro Intasato 5 - GT1",
"Filtro Intasato 6 - GT1",
"Massima temperatura olio - GT1",
"Livello minimo olio - GT1"
]
},
{
"description": "hydraulic Byte_B11",
"tipoMem": "Byte",
"memAddr": "All_Byte_B11",
"index": 11,
"size": 1,
"messages": [
"Massima pressione sterzo - GT1",
"Allarme sensori di pressione su ralle",
"\"GT1 - Sensore livello olio - Massimo livello",
"##",
"Allarme Riserva diesel motore GT1",
"Anomalia motore diesel GT1",
"Timeout disattivazione frizione - inserimento pompe su GT1",
"##"
]
},
{
"description": "hydraulic Byte_B12",
"tipoMem": "Byte",
"memAddr": "All_Byte_B12",
"index": 12,
"size": 1,
"messages": [
"GT1 - Sensore livello olio - Nessun segnale",
"GT1 - Sensore pressione freno - Nessun segnale",
"GT1 - Sensore pressione traslazione - Nessun segnale",
"GT1 - Sensore pressione PVG1 - Nessun segnale",
"GT1 - Sensore pressione PVG2 - Nessun segnale",
"GT1 - Sensore pressione PVG3 - Nessun segnale",
"GT1 - Sensore pressione PVG4 - Nessun segnale",
"GT1 - Sensore pressione PVG5 - Nessun segnale"
]
},
{
"description": "hydraulic Byte_B13",
"tipoMem": "Byte",
"memAddr": "All_Byte_B13",
"index": 13,
"size": 1,
"messages": [
"##",
"##",
"##",
"##",
"##",
"GT1 - Sensore pressione pompa 2 - Nessun segnale",
"GT1 - Sensore pressione pompa 3 - Nessun segnale",
"GT1 - Sensore pressione pompa 4 - Nessun segnale"
]
},
{
"description": "hydraulic Byte_B14",
"tipoMem": "Byte",
"memAddr": "All_Byte_B14",
"index": 14,
"size": 1,
"messages": [
"GT1 - Sensore pressione pompa 5 - Nessun segnale",
"##",
"##",
"##",
"##",
"##",
"##",
"##"
]
},
{
"description": "hydraulic Byte_B15",
"tipoMem": "Byte",
"memAddr": "All_Byte_B15",
"index": 15,
"size": 1,
"messages": [
"Filtro Intasato 1 - GT2",
"Filtro Intasato 2 - GT2",
"Filtro Intasato 3 - GT2",
"Filtro Intasato 4 - GT2",
"Filtro Intasato 5 - GT2",
"Filtro Intasato 6 - GT2",
"##",
"Livello minimo olio - GT2"
]
},
{
"description": "hydraulic Byte_B16",
"tipoMem": "Byte",
"memAddr": "All_Byte_B16",
"index": 16,
"size": 1,
"messages": [
"Massima pressione sterzo - GT2",
"##",
"\"GT2 - Sensore livello olio - Massimo livello",
"##",
"Riserva diesel motore GT2",
"Anomalia motore diesel GT2",
"Timeout disattivazione frizione - inserimento pompe su GT2",
"##"
]
},
{
"description": "hydraulic Byte_B17",
"tipoMem": "Byte",
"memAddr": "All_Byte_B17",
"index": 17,
"size": 1,
"messages": [
"GT2 - Sensore livello olio - Nessun segnale",
"GT2 - Sensore pressione freno - Nessun segnale",
"GT2 - Sensore pressione traslazione - Nessun segnale",
"GT2 - Sensore pressione PVG1 - Nessun segnale",
"GT2 - Sensore pressione PVG2 - Nessun segnale",
"GT2 - Sensore pressione PVG3 - Nessun segnale",
"GT2 - Sensore pressione PVG4 - Nessun segnale",
"GT2 - Sensore pressione PVG5 - Nessun segnale"
]
},
{
"description": "hydraulic Byte_B18",
"tipoMem": "Byte",
"memAddr": "All_Byte_B18",
"index": 18,
"size": 1,
"messages": [
"##",
"##",
"##",
"##",
"##",
"GT2 - Sensore pressione pompa 2 - Nessun segnale",
"GT2 - Sensore pressione pompa 3 - Nessun segnale",
"GT2 - Sensore pressione pompa 4 - Nessun segnale"
]
},
{
"description": "hydraulic Byte_B19",
"tipoMem": "Byte",
"memAddr": "All_Byte_B19",
"index": 19,
"size": 1,
"messages": [
"GT2 - Sensore pressione pompa 5 - Nessun segnale",
"##",
"##",
"##",
"##",
"##",
"##",
"##"
]
},
{
"description": "positioning Byte_B20",
"tipoMem": "Byte",
"memAddr": "All_Byte_B20",
"index": 20,
"size": 1,
"messages": [
"Ruota fuori finestra 1 SX",
"Ruota fuori finestra 2 SX",
"Ruota fuori finestra 3 SX",
"Ruota fuori finestra 4 SX",
"Ruota fuori finestra 5 SX",
"Ruota fuori finestra 6 SX",
"Ruota fuori finestra 7 SX",
"Ruota fuori finestra 8 SX"
]
},
{
"description": "positioning Byte_B21",
"tipoMem": "Byte",
"memAddr": "All_Byte_B21",
"index": 21,
"size": 1,
"messages": [
"Ruota fuori finestra 1 DX",
"Ruota fuori finestra 2 DX",
"Ruota fuori finestra 3 DX",
"Ruota fuori finestra 4 DX",
"Ruota fuori finestra 5 DX",
"Ruota fuori finestra 6 DX",
"Ruota fuori finestra 7 DX",
"Ruota fuori finestra 8 DX"
]
},
{
"description": "positioning Byte_B22",
"tipoMem": "Byte",
"memAddr": "All_Byte_B22",
"index": 22,
"size": 1,
"messages": [
"##",
"Allarme fuori finestra 5\u00b0",
"Allarme fuori finestra 10\u00b0",
"##",
"##",
"##",
"##",
"##"
]
},
{
"description": "wind Byte_B23",
"tipoMem": "Byte",
"memAddr": "All_Byte_B23",
"index": 23,
"size": 1,
"messages": [
"Allarme trasduttore velocit\u00e0 vento",
"Allarme anemometro soglia 1",
"Allarme anemometro soglia 2",
"Bypass inserito - Anemometro",
"##",
"##",
"##",
"##"
]
},
{
"description": "positioning Byte_B24",
"tipoMem": "Byte",
"memAddr": "All_Byte_B24",
"index": 24,
"size": 1,
"messages": [
"Posizione argano 1 fuori finestra",
"Posizione argano 2 fuori finestra",
"Posizione argano 3 fuori finestra",
"Posizione argano 4 fuori finestra",
"Posizione argano 5 fuori finestra",
"Posizione argano 6 fuori finestra",
"Posizione argano 7 fuori finestra",
"Posizione argano 8 fuori finestra"
]
},
{
"description": "positioning Byte_B25",
"tipoMem": "Byte",
"memAddr": "All_Byte_B25",
"index": 25,
"size": 1,
"messages": [
"Posizione Carrello 1 fuori finestra",
"Posizione Carrello 2 fuori finestra",
"Posizione Carrello 3 fuori finestra",
"Posizione Carrello 4 fuori finestra",
"Posizione Carrello 5 fuori finestra",
"Posizione Carrello 6 fuori finestra",
"Posizione Carrello 7 fuori finestra",
"Posizione Carrello 8 fuori finestra"
]
},
{
"description": "Bypass Byte_B26",
"tipoMem": "Byte",
"memAddr": "All_Byte_B26",
"index": 26,
"size": 1,
"messages": [
"Bypass inserito - encoder posizione - Argano 1",
"Bypass inserito - encoder posizione - Argano 2",
"Bypass inserito - encoder posizione - Argano 3",
"Bypass inserito - encoder posizione - Argano 4",
"Bypass inserito - encoder posizione - Argano 5",
"Bypass inserito - encoder posizione - Argano 6",
"Bypass inserito - encoder posizione - Argano 7",
"Bypass inserito - encoder posizione - Argano 8"
]
},
{
"description": "weighting Byte_B27",
"tipoMem": "Byte",
"memAddr": "All_Byte_B27",
"index": 27,
"size": 1,
"messages": [
"Guasto celle canale 1",
"Guasto celle canale 2",
"Guasto celle canale 3",
"Guasto celle canale 4",
"Allarme sovraccarico argani 7-8",
"Allarme sovraccarico argani 5-6",
"Allarme sovraccarico argani 3-4",
"Allarme sovraccarico argani 1-2"
]
},
{
"description": "weighting Byte_B28",
"tipoMem": "Byte",
"memAddr": "All_Byte_B28",
"index": 28,
"size": 1,
"messages": [
"Allarme sovraccarico somma totale",
"Stop sollevamento da controllo baricentro",
"##",
"##",
"##",
"##",
"##",
"##"
]
},
{
"description": "## Byte_B29",
"tipoMem": "Byte",
"memAddr": "All_Byte_B29",
"index": 29,
"size": 1,
"messages": [
"##",
"##",
"##",
"##",
"##",
"##",
"##",
"##"
]
},
{
"description": "bypass Byte_B30",
"tipoMem": "Byte",
"memAddr": "All_Byte_B30",
"index": 30,
"size": 1,
"messages": [
"Bypass inserito - sensore pressione - Ruota SX 1",
"Bypass inserito - sensore pressione - Ruota SX 2",
"Bypass inserito - sensore pressione - Ruota SX 3",
"Bypass inserito - sensore pressione - Ruota SX 4",
"Bypass inserito - sensore pressione - Ruota SX 5",
"Bypass inserito - sensore pressione - Ruota SX 6",
"Bypass inserito - sensore pressione - Ruota SX 7",
"Bypass inserito - sensore pressione - Ruota SX 8"
]
},
{
"description": "bypass Byte_B31",
"tipoMem": "Byte",
"memAddr": "All_Byte_B31",
"index": 31,
"size": 1,
"messages": [
"Bypass inserito - sensore pressione - Ruota DX 1",
"Bypass inserito - sensore pressione - Ruota DX 2",
"Bypass inserito - sensore pressione - Ruota DX 3",
"Bypass inserito - sensore pressione - Ruota DX 4",
"Bypass inserito - sensore pressione - Ruota DX 5",
"Bypass inserito - sensore pressione - Ruota DX 6",
"Bypass inserito - sensore pressione - Ruota DX 7",
"Bypass inserito - sensore pressione - Ruota DX 8"
]
},
{
"description": "bypass Byte_B32",
"tipoMem": "Byte",
"memAddr": "All_Byte_B32",
"index": 32,
"size": 1,
"messages": [
"Bypass inserito - sensore posizione - Carrello 1",
"Bypass inserito - sensore posizione - Carrello 2",
"Bypass inserito - sensore posizione - Carrello 3",
"Bypass inserito - sensore posizione - Carrello 4",
"Bypass inserito - sensore posizione - Carrello 5",
"Bypass inserito - sensore posizione - Carrello 6",
"Bypass inserito - sensore posizione - Carrello 7",
"Bypass inserito - sensore posizione - Carrello 8"
]
},
{
"description": "Bypass Byte_B33",
"tipoMem": "Byte",
"memAddr": "All_Byte_B33",
"index": 33,
"size": 1,
"messages": [
"Bypass inserito - encoder posizione - Carrello 1",
"Bypass inserito - encoder posizione - Carrello 2",
"Bypass inserito - encoder posizione - Carrello 3",
"Bypass inserito - encoder posizione - Carrello 4",
"Bypass inserito - encoder posizione - Carrello 5",
"Bypass inserito - encoder posizione - Carrello 6",
"Bypass inserito - encoder posizione - Carrello 7",
"Bypass inserito - encoder posizione - Carrello 8"
]
},
{
"description": "bypass Byte_B34",
"tipoMem": "Byte",
"memAddr": "All_Byte_B34",
"index": 34,
"size": 1,
"messages": [
"Bypass inserito - finecorsa posizione - Argano 1",
"Bypass inserito - finecorsa posizione - Argano 2",
"Bypass inserito - finecorsa posizione - Argano 3",
"Bypass inserito - finecorsa posizione - Argano 4",
"Bypass inserito - finecorsa posizione - Argano 5",
"Bypass inserito - finecorsa posizione - Argano 6",
"Bypass inserito - finecorsa posizione - Argano 7",
"Bypass inserito - finecorsa posizione - Argano 8"
]
},
{
"description": "bypass Byte_B35",
"tipoMem": "Byte",
"memAddr": "All_Byte_B35",
"index": 35,
"size": 1,
"messages": [
"Bypass inserito - controllo posizione baricentro",
"##",
"##",
"##",
"##",
"##",
"##",
"##"
]
},
{
"description": "## Byte_B36",
"tipoMem": "Byte",
"memAddr": "All_Byte_B36",
"index": 36,
"size": 1,
"messages": [
"##",
"##",
"##",
"##",
"##",
"##",
"##",
"##"
]
},
{
"description": "## Byte_B37",
"tipoMem": "Byte",
"memAddr": "All_Byte_B37",
"index": 37,
"size": 1,
"messages": [
"Richiesta manutenzione traslazione",
"Richiesta manutenzione sterzatura",
"Richiesta manutenzione motore GT1",
"Richiesta manutenzione motore GT2",
"Richiesta manutenzione argani",
"Richiesta manutenzione carrelli",
"##",
"##"
]
},
{
"description": "n/a Byte_B38",
"tipoMem": "Byte",
"memAddr": "n/a",
"index": 38,
"size": 1,
"messages": [
"n/a",
"n/a",
"n/a",
"n/a",
"n/a",
"n/a",
"n/a"
]
}
]
+27
View File
@@ -0,0 +1,27 @@
# Utility Scripts
In questa cartella si trovano alcuni script di utility per al gestione dei vari sw IOB.
## Gestione Allarmi
Per la gestione allarmi sono necessari file **nome_macchina_alarm.json** la cui produzione manuale è onerosa.
Zac piuttosto che farlo a mano si è quindi procurato uno script di conversione dal formato csv / excel al json richiesto.
**alarmFormatter.py** è uno script python3 che esegue questo compito partendo da un file alarm.csv che si trova nella stessa folder del file python stesso
### Prerequisiti
Per impiegare lo script è necessario l'ambiente python3 + una libreria specifica
```
choco install python3
```
e poi una volta installato python
```python
pip install inquirer
```
pacchetto per gestire la scelta del file di lettura
Binary file not shown.
+79
View File
@@ -0,0 +1,79 @@
import json
import os
import inquirer
import pathlib
# get current dir path
dir_path = pathlib.Path().resolve()
res = []
# iterazione nella directory
for path in os.listdir(dir_path):
# controllo se il file seguente è una directory
if os.path.isfile(os.path.join(dir_path, path)):
res.append(path)
# creazione oggetto inquirer
files = [
inquirer.List('file',
message="Seleziona il file",
choices=res,
),
]
#stampa scelte sul terminale
answers = inquirer.prompt(files)
print(answers["file"])
nFileJSON = input("Inserire nome file di scrittura: ")
stop = bool(True)
n1 = 0
n2 = 8
index = 0
with open(answers["file"], 'r', encoding='utf-8') as fp:
lines = fp.readlines();
fopen = open(nFileJSON, "a", encoding='utf-8')
fopen.write("[")
while stop:
x = lines[n1:n2]
alarmsList = []
i = 0
alarms=""
for k in x:
# gestione stringhe
alarms = x[i].split(',')[4].replace("\n", "")
splitLines = x[i].split(';')
group = splitLines[1]
if not alarms or alarms =='':
alarms = alarms.replace("", "##")
if not group or group == "":
group = group.replace("", " ")
alarmsList.append(alarms)
i= i + 1
# Creazione oggetto json
data = {
'description' : group + ' ' + 'Byte_B'+str(index),
'tipoMem' : 'Byte',
'memAddr' : splitLines[2],
'index' : index,
'size' : 1,
'messages' : tuple(alarmsList)
}
# Serializzazione json
json_object = json.dumps(data, indent=4)
# Scrittura nel file
fopen.write("\r" + json_object + ",\r")
n1 = n1 + 8
n2 = n2 + 8
index = index+1
# Stop script
if splitLines[2] == "n/a":
stop = bool(False)
fopen.write("]")
+311
View File
@@ -0,0 +1,311 @@
Alarm-00-0,profinet,All_Byte_B0,0,Allarme comunicazione profinet - I/O GT2
Alarm-00-1,profinet,All_Byte_B0,1,Allarme comunicazione profinet - Sistema di pesatura
Alarm-00-2,profinet,All_Byte_B0,2,Allarme comunicazione - Ricevente radiocomando
Alarm-00-3,profinet,All_Byte_B0,3,Allarme comunicazione CanOpen - Motore GT1
Alarm-00-4,profinet,All_Byte_B0,4,Allarme comunicazione CanOpen - Motore GT2
Alarm-00-5,profinet,All_Byte_B0,5,
Alarm-00-6,profinet,All_Byte_B0,6,
Alarm-00-7,profinet,All_Byte_B0,7,
Alarm-01-0,profinet,All_Byte_B1,0,Allarme comunicazione profinet - Modulo IOlink 1(TU) {A190.1}
Alarm-01-1,profinet,All_Byte_B1,1,Allarme comunicazione profinet - Modulo IOlink 2(TU) {A190.2}
Alarm-01-2,profinet,All_Byte_B1,2,Allarme comunicazione profinet - Modulo IOlink 3(TU) {A190.3}
Alarm-01-3,profinet,All_Byte_B1,3,Allarme comunicazione profinet - Modulo IOlink 1(LB) {A206.1}
Alarm-01-4,profinet,All_Byte_B1,4,Allarme comunicazione profinet - Modulo IOlink 2(LB) {A206.2}
Alarm-01-5,profinet,All_Byte_B1,5,Allarme comunicazione profinet - Modulo IOlink 3(LB) {A206.3}
Alarm-01-6,profinet,All_Byte_B1,6,Allarme comunicazione profinet - Modulo IOlink 6(LB) {A206.6}
Alarm-01-7,profinet,All_Byte_B1,7,Allarme comunicazione profinet - Modulo IOlink 1(UB) {A231.1}
Alarm-02-0,profinet,All_Byte_B2,0,Allarme comunicazione profinet - Modulo IOlink 1.1(TU) {A690.1}
Alarm-02-1,profinet,All_Byte_B2,1,Allarme comunicazione profinet - Modulo IOlink 2.1(TU) {A690.2}
Alarm-02-2,profinet,All_Byte_B2,2,Allarme comunicazione profinet - Modulo IOlink 3.1(TU) {A690.3}
Alarm-02-3,profinet,All_Byte_B2,3,Allarme comunicazione profinet - Modulo IOlink 1.1(LB) {A706.1}
Alarm-02-4,profinet,All_Byte_B2,4,Allarme comunicazione profinet - Modulo IOlink 2.1(LB) {A706.2}
Alarm-02-5,profinet,All_Byte_B2,5,Allarme comunicazione profinet - Modulo IOlink 3.1(LB) {A706.3}
Alarm-02-6,profinet,All_Byte_B2,6,Allarme comunicazione profinet - Modulo IOlink 6.1(LB) {A706.6}
Alarm-02-7,profinet,All_Byte_B2,7,Allarme comunicazione profinet - Modulo IOlink 1.1(UB) {A731.1}
Alarm-03-0,profinet,All_Byte_B3,0,Allarme comunicazione profinet - Encoder ruota 1 sinistra
Alarm-03-1,profinet,All_Byte_B3,1,Allarme comunicazione profinet - Encoder ruota 2 sinistra
Alarm-03-2,profinet,All_Byte_B3,2,Allarme comunicazione profinet - Encoder ruota 3 sinistra
Alarm-03-3,profinet,All_Byte_B3,3,Allarme comunicazione profinet - Encoder ruota 4 sinistra
Alarm-03-4,profinet,All_Byte_B3,4,Allarme comunicazione profinet - Encoder ruota 5 sinistra
Alarm-03-5,profinet,All_Byte_B3,5,Allarme comunicazione profinet - Encoder ruota 6 sinistra
Alarm-03-6,profinet,All_Byte_B3,6,Allarme comunicazione profinet - Encoder ruota 7 sinistra
Alarm-03-7,profinet,All_Byte_B3,7,Allarme comunicazione profinet - Encoder ruota 8 sinistra
Alarm-04-0,profinet,All_Byte_B4,0,Allarme comunicazione profinet - Encoder ruota 1 destra
Alarm-04-1,profinet,All_Byte_B4,1,Allarme comunicazione profinet - Encoder ruota 2 destra
Alarm-04-2,profinet,All_Byte_B4,2,Allarme comunicazione profinet - Encoder ruota 3 destra
Alarm-04-3,profinet,All_Byte_B4,3,Allarme comunicazione profinet - Encoder ruota 4 destra
Alarm-04-4,profinet,All_Byte_B4,4,Allarme comunicazione profinet - Encoder ruota 5 destra
Alarm-04-5,profinet,All_Byte_B4,5,Allarme comunicazione profinet - Encoder ruota 6 destra
Alarm-04-6,profinet,All_Byte_B4,6,Allarme comunicazione profinet - Encoder ruota 7 destra
Alarm-04-7,profinet,All_Byte_B4,7,Allarme comunicazione profinet - Encoder ruota 8 destra
Alarm-05-0,profinet,All_Byte_B5,0,Allarme comunicazione profinet - encoder carrello 1
Alarm-05-1,profinet,All_Byte_B5,1,Allarme comunicazione profinet - encoder carrello 2
Alarm-05-2,profinet,All_Byte_B5,2,Allarme comunicazione profinet - encoder carrello 3
Alarm-05-3,profinet,All_Byte_B5,3,Allarme comunicazione profinet - encoder carrello 4
Alarm-05-4,profinet,All_Byte_B5,4,Allarme comunicazione profinet - encoder carrello 5
Alarm-05-5,profinet,All_Byte_B5,5,Allarme comunicazione profinet - encoder carrello 6
Alarm-05-6,profinet,All_Byte_B5,6,Allarme comunicazione profinet - encoder carrello 7
Alarm-05-7,profinet,All_Byte_B5,7,Allarme comunicazione profinet - encoder carrello 8
Alarm-06-0,profinet,All_Byte_B6,0,Allarme comunicazione profinet - encoder argano 1
Alarm-06-1,profinet,All_Byte_B6,1,Allarme comunicazione profinet - encoder argano 2
Alarm-06-2,profinet,All_Byte_B6,2,Allarme comunicazione profinet - encoder argano 3
Alarm-06-3,profinet,All_Byte_B6,3,Allarme comunicazione profinet - encoder argano 4
Alarm-06-4,profinet,All_Byte_B6,4,Allarme comunicazione profinet - encoder argano 5
Alarm-06-5,profinet,All_Byte_B6,5,Allarme comunicazione profinet - encoder argano 6
Alarm-06-6,profinet,All_Byte_B6,6,Allarme comunicazione profinet - encoder argano 7
Alarm-06-7,profinet,All_Byte_B6,7,Allarme comunicazione profinet - encoder argano 8
Alarm-07-0,message,All_Byte_B7,0,Pulsante emergenza premuto su ruota 1 SX
Alarm-07-1,message,All_Byte_B7,1,Pulsante emergenza premuto su ruota 2 SX
Alarm-07-2,message,All_Byte_B7,2,Pulsante emergenza premuto su ruota 3 SX
Alarm-07-3,message,All_Byte_B7,3,Pulsante emergenza premuto su ruota 4 SX
Alarm-07-4,message,All_Byte_B7,4,Pulsante emergenza premuto su ruota 5 SX
Alarm-07-5,message,All_Byte_B7,5,Pulsante emergenza premuto su ruota 6 SX
Alarm-07-6,message,All_Byte_B7,6,Pulsante emergenza premuto su ruota 7 SX
Alarm-07-7,message,All_Byte_B7,7,Pulsante emergenza premuto su ruota 8 SX
Alarm-08-0,message,All_Byte_B8,0,Pulsante emergenza premuto su ruota 1 DX
Alarm-08-1,message,All_Byte_B8,1,Pulsante emergenza premuto su ruota 2 DX
Alarm-08-2,message,All_Byte_B8,2,Pulsante emergenza premuto su ruota 3 DX
Alarm-08-3,message,All_Byte_B8,3,Pulsante emergenza premuto su ruota 4 DX
Alarm-08-4,message,All_Byte_B8,4,Pulsante emergenza premuto su ruota 5 DX
Alarm-08-5,message,All_Byte_B8,5,Pulsante emergenza premuto su ruota 6 DX
Alarm-08-6,message,All_Byte_B8,6,Pulsante emergenza premuto su ruota 7 DX
Alarm-08-7,message,All_Byte_B8,7,Pulsante emergenza premuto su ruota 8 DX
Alarm-09-0,message,All_Byte_B9,0,Pulsante emergenza premuto su QE GT1
Alarm-09-1,message,All_Byte_B9,1,Pulsante emergenza premuto su QE GT2
Alarm-09-2,message,All_Byte_B9,2,Radiocomando spento o fungo di emergenza premuto
Alarm-09-3,message,All_Byte_B9,3,
Alarm-09-4,message,All_Byte_B9,4,
Alarm-09-5,message,All_Byte_B9,5,
Alarm-09-6,message,All_Byte_B9,6,
Alarm-09-7,message,All_Byte_B9,7,
Alarm-10-0,message,All_Byte_B10,0,Filtro Intasato 1 - GT1
Alarm-10-1,message,All_Byte_B10,1,Filtro Intasato 2 - GT1
Alarm-10-2,message,All_Byte_B10,2,Filtro Intasato 3 - GT1
Alarm-10-3,message,All_Byte_B10,3,Filtro Intasato 4 - GT1
Alarm-10-4,message,All_Byte_B10,4,Filtro Intasato 5 - GT1
Alarm-10-5,message,All_Byte_B10,5,Filtro Intasato 6 - GT1
Alarm-10-6,hydraulic,All_Byte_B10,6,Massima temperatura olio - GT1
Alarm-10-7,hydraulic,All_Byte_B10,7,Livello minimo olio - GT1
Alarm-11-0,hydraulic,All_Byte_B11,0,Massima pressione sterzo - GT1
Alarm-11-1,hydraulic,All_Byte_B11,1,Allarme sensori di pressione su ralle
Alarm-11-2,hydraulic,All_Byte_B11,2,"GT1 - Sensore livello olio - Massimo livello, Stop movimenti"
Alarm-11-3,hydraulic,All_Byte_B11,3,
Alarm-11-4,message,All_Byte_B11,4,Allarme Riserva diesel motore GT1
Alarm-11-5,hydraulic,All_Byte_B11,5,Anomalia motore diesel GT1
Alarm-11-6,hydraulic,All_Byte_B11,6,Timeout disattivazione frizione - inserimento pompe su GT1
Alarm-11-7,hydraulic,All_Byte_B11,7,
Alarm-12-0,hydraulic,All_Byte_B12,0,GT1 - Sensore livello olio - Nessun segnale
Alarm-12-1,hydraulic,All_Byte_B12,1,GT1 - Sensore pressione freno - Nessun segnale
Alarm-12-2,hydraulic,All_Byte_B12,2,GT1 - Sensore pressione traslazione - Nessun segnale
Alarm-12-3,hydraulic,All_Byte_B12,3,GT1 - Sensore pressione PVG1 - Nessun segnale
Alarm-12-4,hydraulic,All_Byte_B12,4,GT1 - Sensore pressione PVG2 - Nessun segnale
Alarm-12-5,hydraulic,All_Byte_B12,5,GT1 - Sensore pressione PVG3 - Nessun segnale
Alarm-12-6,hydraulic,All_Byte_B12,6,GT1 - Sensore pressione PVG4 - Nessun segnale
Alarm-12-7,hydraulic,All_Byte_B12,7,GT1 - Sensore pressione PVG5 - Nessun segnale
Alarm-13-0,hydraulic,All_Byte_B13,0,
Alarm-13-1,hydraulic,All_Byte_B13,1,
Alarm-13-2,hydraulic,All_Byte_B13,2,
Alarm-13-3,hydraulic,All_Byte_B13,3,
Alarm-13-4,hydraulic,All_Byte_B13,4,
Alarm-13-5,hydraulic,All_Byte_B13,5,GT1 - Sensore pressione pompa 2 - Nessun segnale
Alarm-13-6,hydraulic,All_Byte_B13,6,GT1 - Sensore pressione pompa 3 - Nessun segnale
Alarm-13-7,hydraulic,All_Byte_B13,7,GT1 - Sensore pressione pompa 4 - Nessun segnale
Alarm-14-0,hydraulic,All_Byte_B14,0,GT1 - Sensore pressione pompa 5 - Nessun segnale
Alarm-14-1,hydraulic,All_Byte_B14,1,
Alarm-14-2,hydraulic,All_Byte_B14,2,
Alarm-14-3,hydraulic,All_Byte_B14,3,
Alarm-14-4,hydraulic,All_Byte_B14,4,
Alarm-14-5,hydraulic,All_Byte_B14,5,
Alarm-14-6,hydraulic,All_Byte_B14,6,
Alarm-14-7,hydraulic,All_Byte_B14,7,
Alarm-15-0,message,All_Byte_B15,0,Filtro Intasato 1 - GT2
Alarm-15-1,message,All_Byte_B15,1,Filtro Intasato 2 - GT2
Alarm-15-2,message,All_Byte_B15,2,Filtro Intasato 3 - GT2
Alarm-15-3,message,All_Byte_B15,3,Filtro Intasato 4 - GT2
Alarm-15-4,message,All_Byte_B15,4,Filtro Intasato 5 - GT2
Alarm-15-5,message,All_Byte_B15,5,Filtro Intasato 6 - GT2
Alarm-15-6,message,All_Byte_B15,6,
Alarm-15-7,hydraulic,All_Byte_B15,7,Livello minimo olio - GT2
Alarm-16-0,hydraulic,All_Byte_B16,0,Massima pressione sterzo - GT2
Alarm-16-1,hydraulic,All_Byte_B16,1,
Alarm-16-2,hydraulic,All_Byte_B16,2,"GT2 - Sensore livello olio - Massimo livello, Stop movimenti"
Alarm-16-3,hydraulic,All_Byte_B16,3,
Alarm-16-4,hydraulic,All_Byte_B16,4,Riserva diesel motore GT2
Alarm-16-5,hydraulic,All_Byte_B16,5,Anomalia motore diesel GT2
Alarm-16-6,hydraulic,All_Byte_B16,6,Timeout disattivazione frizione - inserimento pompe su GT2
Alarm-16-7,hydraulic,All_Byte_B16,7,
Alarm-17-0,hydraulic,All_Byte_B17,0,GT2 - Sensore livello olio - Nessun segnale
Alarm-17-1,hydraulic,All_Byte_B17,1,GT2 - Sensore pressione freno - Nessun segnale
Alarm-17-2,hydraulic,All_Byte_B17,2,GT2 - Sensore pressione traslazione - Nessun segnale
Alarm-17-3,hydraulic,All_Byte_B17,3,GT2 - Sensore pressione PVG1 - Nessun segnale
Alarm-17-4,hydraulic,All_Byte_B17,4,GT2 - Sensore pressione PVG2 - Nessun segnale
Alarm-17-5,hydraulic,All_Byte_B17,5,GT2 - Sensore pressione PVG3 - Nessun segnale
Alarm-17-6,hydraulic,All_Byte_B17,6,GT2 - Sensore pressione PVG4 - Nessun segnale
Alarm-17-7,hydraulic,All_Byte_B17,7,GT2 - Sensore pressione PVG5 - Nessun segnale
Alarm-18-0,hydraulic,All_Byte_B18,0,
Alarm-18-1,hydraulic,All_Byte_B18,1,
Alarm-18-2,hydraulic,All_Byte_B18,2,
Alarm-18-3,hydraulic,All_Byte_B18,3,
Alarm-18-4,hydraulic,All_Byte_B18,4,
Alarm-18-5,hydraulic,All_Byte_B18,5,GT2 - Sensore pressione pompa 2 - Nessun segnale
Alarm-18-6,hydraulic,All_Byte_B18,6,GT2 - Sensore pressione pompa 3 - Nessun segnale
Alarm-18-7,hydraulic,All_Byte_B18,7,GT2 - Sensore pressione pompa 4 - Nessun segnale
Alarm-19-0,hydraulic,All_Byte_B19,0,GT2 - Sensore pressione pompa 5 - Nessun segnale
Alarm-19-1,hydraulic,All_Byte_B19,1,
Alarm-19-2,hydraulic,All_Byte_B19,2,
Alarm-19-3,hydraulic,All_Byte_B19,3,
Alarm-19-4,hydraulic,All_Byte_B19,4,
Alarm-19-5,hydraulic,All_Byte_B19,5,
Alarm-19-6,hydraulic,All_Byte_B19,6,
Alarm-19-7,hydraulic,All_Byte_B19,7,
Alarm-20-0,positioning,All_Byte_B20,0,Ruota fuori finestra 1 SX
Alarm-20-1,positioning,All_Byte_B20,1,Ruota fuori finestra 2 SX
Alarm-20-2,positioning,All_Byte_B20,2,Ruota fuori finestra 3 SX
Alarm-20-3,positioning,All_Byte_B20,3,Ruota fuori finestra 4 SX
Alarm-20-4,positioning,All_Byte_B20,4,Ruota fuori finestra 5 SX
Alarm-20-5,positioning,All_Byte_B20,5,Ruota fuori finestra 6 SX
Alarm-20-6,positioning,All_Byte_B20,6,Ruota fuori finestra 7 SX
Alarm-20-7,positioning,All_Byte_B20,7,Ruota fuori finestra 8 SX
Alarm-21-0,positioning,All_Byte_B21,0,Ruota fuori finestra 1 DX
Alarm-21-1,positioning,All_Byte_B21,1,Ruota fuori finestra 2 DX
Alarm-21-2,positioning,All_Byte_B21,2,Ruota fuori finestra 3 DX
Alarm-21-3,positioning,All_Byte_B21,3,Ruota fuori finestra 4 DX
Alarm-21-4,positioning,All_Byte_B21,4,Ruota fuori finestra 5 DX
Alarm-21-5,positioning,All_Byte_B21,5,Ruota fuori finestra 6 DX
Alarm-21-6,positioning,All_Byte_B21,6,Ruota fuori finestra 7 DX
Alarm-21-7,positioning,All_Byte_B21,7,Ruota fuori finestra 8 DX
Alarm-22-0,positioning,All_Byte_B22,0,
Alarm-22-1,positioning,All_Byte_B22,1,Allarme fuori finestra 5°
Alarm-22-2,positioning,All_Byte_B22,2,Allarme fuori finestra 10°
Alarm-22-3,positioning,All_Byte_B22,3,
Alarm-22-4,positioning,All_Byte_B22,4,
Alarm-22-5,positioning,All_Byte_B22,5,
Alarm-22-6,positioning,All_Byte_B22,6,
Alarm-22-7,positioning,All_Byte_B22,7,
Alarm-23-0,wind,All_Byte_B23,0,Allarme trasduttore velocità vento
Alarm-23-1,wind,All_Byte_B23,1,Allarme anemometro soglia 1
Alarm-23-2,wind,All_Byte_B23,2,Allarme anemometro soglia 2
Alarm-23-3,wind;Bypass,All_Byte_B23,3,Bypass inserito - Anemometro
Alarm-23-4,wind,All_Byte_B23,4,
Alarm-23-5,wind,All_Byte_B23,5,
Alarm-23-6,wind,All_Byte_B23,6,
Alarm-23-7,wind,All_Byte_B23,7,
Alarm-24-0,positioning,All_Byte_B24,0,Posizione argano 1 fuori finestra
Alarm-24-1,positioning,All_Byte_B24,1,Posizione argano 2 fuori finestra
Alarm-24-2,positioning,All_Byte_B24,2,Posizione argano 3 fuori finestra
Alarm-24-3,positioning,All_Byte_B24,3,Posizione argano 4 fuori finestra
Alarm-24-4,positioning,All_Byte_B24,4,Posizione argano 5 fuori finestra
Alarm-24-5,positioning,All_Byte_B24,5,Posizione argano 6 fuori finestra
Alarm-24-6,positioning,All_Byte_B24,6,Posizione argano 7 fuori finestra
Alarm-24-7,positioning,All_Byte_B24,7,Posizione argano 8 fuori finestra
Alarm-25-0,positioning,All_Byte_B25,0,Posizione Carrello 1 fuori finestra
Alarm-25-1,positioning,All_Byte_B25,1,Posizione Carrello 2 fuori finestra
Alarm-25-2,positioning,All_Byte_B25,2,Posizione Carrello 3 fuori finestra
Alarm-25-3,positioning,All_Byte_B25,3,Posizione Carrello 4 fuori finestra
Alarm-25-4,positioning,All_Byte_B25,4,Posizione Carrello 5 fuori finestra
Alarm-25-5,positioning,All_Byte_B25,5,Posizione Carrello 6 fuori finestra
Alarm-25-6,positioning,All_Byte_B25,6,Posizione Carrello 7 fuori finestra
Alarm-25-7,positioning,All_Byte_B25,7,Posizione Carrello 8 fuori finestra
Alarm-26-0,Bypass,All_Byte_B26,0,Bypass inserito - encoder posizione - Argano 1
Alarm-26-1,Bypass,All_Byte_B26,1,Bypass inserito - encoder posizione - Argano 2
Alarm-26-2,Bypass,All_Byte_B26,2,Bypass inserito - encoder posizione - Argano 3
Alarm-26-3,Bypass,All_Byte_B26,3,Bypass inserito - encoder posizione - Argano 4
Alarm-26-4,Bypass,All_Byte_B26,4,Bypass inserito - encoder posizione - Argano 5
Alarm-26-5,Bypass,All_Byte_B26,5,Bypass inserito - encoder posizione - Argano 6
Alarm-26-6,Bypass,All_Byte_B26,6,Bypass inserito - encoder posizione - Argano 7
Alarm-26-7,Bypass,All_Byte_B26,7,Bypass inserito - encoder posizione - Argano 8
Alarm-27-0,weighting,All_Byte_B27,0,Guasto celle canale 1
Alarm-27-1,weighting,All_Byte_B27,1,Guasto celle canale 2
Alarm-27-2,weighting,All_Byte_B27,2,Guasto celle canale 3
Alarm-27-3,weighting,All_Byte_B27,3,Guasto celle canale 4
Alarm-27-4,weighting,All_Byte_B27,4,Allarme sovraccarico argani 7-8
Alarm-27-5,weighting,All_Byte_B27,5,Allarme sovraccarico argani 5-6
Alarm-27-6,weighting,All_Byte_B27,6,Allarme sovraccarico argani 3-4
Alarm-27-7,weighting,All_Byte_B27,7,Allarme sovraccarico argani 1-2
Alarm-28-0,weighting,All_Byte_B28,0,Allarme sovraccarico somma totale
Alarm-28-1,weighting,All_Byte_B28,1,Stop sollevamento da controllo baricentro
Alarm-28-2,weighting,All_Byte_B28,2,
Alarm-28-3,weighting,All_Byte_B28,3,
Alarm-28-4,weighting,All_Byte_B28,4,
Alarm-28-5,weighting,All_Byte_B28,5,
Alarm-28-6,weighting,All_Byte_B28,6,
Alarm-28-7,weighting,All_Byte_B28,7,
Alarm-29-0,,All_Byte_B29,0,
Alarm-29-1,,All_Byte_B29,1,
Alarm-29-2,,All_Byte_B29,2,
Alarm-29-3,,All_Byte_B29,3,
Alarm-29-4,,All_Byte_B29,4,
Alarm-29-5,,All_Byte_B29,5,
Alarm-29-6,,All_Byte_B29,6,
Alarm-29-7,,All_Byte_B29,7,
Alarm-30-0,bypass,All_Byte_B30,0,Bypass inserito - sensore pressione - Ruota SX 1
Alarm-30-1,bypass,All_Byte_B30,1,Bypass inserito - sensore pressione - Ruota SX 2
Alarm-30-2,bypass,All_Byte_B30,2,Bypass inserito - sensore pressione - Ruota SX 3
Alarm-30-3,bypass,All_Byte_B30,3,Bypass inserito - sensore pressione - Ruota SX 4
Alarm-30-4,bypass,All_Byte_B30,4,Bypass inserito - sensore pressione - Ruota SX 5
Alarm-30-5,bypass,All_Byte_B30,5,Bypass inserito - sensore pressione - Ruota SX 6
Alarm-30-6,bypass,All_Byte_B30,6,Bypass inserito - sensore pressione - Ruota SX 7
Alarm-30-7,bypass,All_Byte_B30,7,Bypass inserito - sensore pressione - Ruota SX 8
Alarm-31-0,bypass,All_Byte_B31,0,Bypass inserito - sensore pressione - Ruota DX 1
Alarm-31-1,bypass,All_Byte_B31,1,Bypass inserito - sensore pressione - Ruota DX 2
Alarm-31-2,bypass,All_Byte_B31,2,Bypass inserito - sensore pressione - Ruota DX 3
Alarm-31-3,bypass,All_Byte_B31,3,Bypass inserito - sensore pressione - Ruota DX 4
Alarm-31-4,bypass,All_Byte_B31,4,Bypass inserito - sensore pressione - Ruota DX 5
Alarm-31-5,bypass,All_Byte_B31,5,Bypass inserito - sensore pressione - Ruota DX 6
Alarm-31-6,bypass,All_Byte_B31,6,Bypass inserito - sensore pressione - Ruota DX 7
Alarm-31-7,bypass,All_Byte_B31,7,Bypass inserito - sensore pressione - Ruota DX 8
Alarm-32-0,bypass,All_Byte_B32,0,Bypass inserito - sensore posizione - Carrello 1
Alarm-32-1,bypass,All_Byte_B32,1,Bypass inserito - sensore posizione - Carrello 2
Alarm-32-2,bypass,All_Byte_B32,2,Bypass inserito - sensore posizione - Carrello 3
Alarm-32-3,bypass,All_Byte_B32,3,Bypass inserito - sensore posizione - Carrello 4
Alarm-32-4,bypass,All_Byte_B32,4,Bypass inserito - sensore posizione - Carrello 5
Alarm-32-5,bypass,All_Byte_B32,5,Bypass inserito - sensore posizione - Carrello 6
Alarm-32-6,bypass,All_Byte_B32,6,Bypass inserito - sensore posizione - Carrello 7
Alarm-32-7,bypass,All_Byte_B32,7,Bypass inserito - sensore posizione - Carrello 8
Alarm-33-0,Bypass,All_Byte_B33,0,Bypass inserito - encoder posizione - Carrello 1
Alarm-33-1,Bypass,All_Byte_B33,1,Bypass inserito - encoder posizione - Carrello 2
Alarm-33-2,Bypass,All_Byte_B33,2,Bypass inserito - encoder posizione - Carrello 3
Alarm-33-3,Bypass,All_Byte_B33,3,Bypass inserito - encoder posizione - Carrello 4
Alarm-33-4,Bypass,All_Byte_B33,4,Bypass inserito - encoder posizione - Carrello 5
Alarm-33-5,Bypass,All_Byte_B33,5,Bypass inserito - encoder posizione - Carrello 6
Alarm-33-6,Bypass,All_Byte_B33,6,Bypass inserito - encoder posizione - Carrello 7
Alarm-33-7,Bypass,All_Byte_B33,7,Bypass inserito - encoder posizione - Carrello 8
Alarm-34-0,bypass,All_Byte_B34,0,Bypass inserito - finecorsa posizione - Argano 1
Alarm-34-1,bypass,All_Byte_B34,1,Bypass inserito - finecorsa posizione - Argano 2
Alarm-34-2,bypass,All_Byte_B34,2,Bypass inserito - finecorsa posizione - Argano 3
Alarm-34-3,bypass,All_Byte_B34,3,Bypass inserito - finecorsa posizione - Argano 4
Alarm-34-4,bypass,All_Byte_B34,4,Bypass inserito - finecorsa posizione - Argano 5
Alarm-34-5,bypass,All_Byte_B34,5,Bypass inserito - finecorsa posizione - Argano 6
Alarm-34-6,bypass,All_Byte_B34,6,Bypass inserito - finecorsa posizione - Argano 7
Alarm-34-7,bypass,All_Byte_B34,7,Bypass inserito - finecorsa posizione - Argano 8
Alarm-35-0,bypass,All_Byte_B35,0,Bypass inserito - controllo posizione baricentro
Alarm-35-0,bypass,All_Byte_B35,1,
Alarm-35-0,bypass,All_Byte_B35,2,
Alarm-35-0,bypass,All_Byte_B35,3,
Alarm-35-0,bypass,All_Byte_B35,4,
Alarm-35-0,bypass,All_Byte_B35,5,
Alarm-35-0,bypass,All_Byte_B35,6,
Alarm-35-0,bypass,All_Byte_B35,7,
Alarm-36-0,,All_Byte_B36,0,
Alarm-36-1,,All_Byte_B36,1,
Alarm-36-2,,All_Byte_B36,2,
Alarm-36-3,,All_Byte_B36,3,
Alarm-36-4,,All_Byte_B36,4,
Alarm-36-5,,All_Byte_B36,5,
Alarm-36-6,,All_Byte_B36,6,
Alarm-36-7,,All_Byte_B36,7,
Alarm-37-0,maintenance,All_Byte_B37,0,Richiesta manutenzione traslazione
Alarm-37-1,maintenance,All_Byte_B37,1,Richiesta manutenzione sterzatura
Alarm-37-2,maintenance,All_Byte_B37,2,Richiesta manutenzione motore GT1
Alarm-37-3,maintenance,All_Byte_B37,3,Richiesta manutenzione motore GT2
Alarm-37-4,maintenance,All_Byte_B37,4,Richiesta manutenzione argani
Alarm-37-5,maintenance,All_Byte_B37,5,Richiesta manutenzione carrelli
Alarm-37-6,,All_Byte_B37,6,
Alarm-37-7,,All_Byte_B37,7,
n/a,n/a,n/a,,n/a
n/a,n/a,n/a,,n/a
n/a,n/a,n/a,,n/a
n/a,n/a,n/a,,n/a
n/a,n/a,n/a,,n/a
n/a,n/a,n/a,,n/a
n/a,n/a,n/a,,n/a
1 Alarm-00-0 profinet All_Byte_B0 0 Allarme comunicazione profinet - I/O GT2
2 Alarm-00-1 profinet All_Byte_B0 1 Allarme comunicazione profinet - Sistema di pesatura
3 Alarm-00-2 profinet All_Byte_B0 2 Allarme comunicazione - Ricevente radiocomando
4 Alarm-00-3 profinet All_Byte_B0 3 Allarme comunicazione CanOpen - Motore GT1
5 Alarm-00-4 profinet All_Byte_B0 4 Allarme comunicazione CanOpen - Motore GT2
6 Alarm-00-5 profinet All_Byte_B0 5
7 Alarm-00-6 profinet All_Byte_B0 6
8 Alarm-00-7 profinet All_Byte_B0 7
9 Alarm-01-0 profinet All_Byte_B1 0 Allarme comunicazione profinet - Modulo IOlink 1(TU) {A190.1}
10 Alarm-01-1 profinet All_Byte_B1 1 Allarme comunicazione profinet - Modulo IOlink 2(TU) {A190.2}
11 Alarm-01-2 profinet All_Byte_B1 2 Allarme comunicazione profinet - Modulo IOlink 3(TU) {A190.3}
12 Alarm-01-3 profinet All_Byte_B1 3 Allarme comunicazione profinet - Modulo IOlink 1(LB) {A206.1}
13 Alarm-01-4 profinet All_Byte_B1 4 Allarme comunicazione profinet - Modulo IOlink 2(LB) {A206.2}
14 Alarm-01-5 profinet All_Byte_B1 5 Allarme comunicazione profinet - Modulo IOlink 3(LB) {A206.3}
15 Alarm-01-6 profinet All_Byte_B1 6 Allarme comunicazione profinet - Modulo IOlink 6(LB) {A206.6}
16 Alarm-01-7 profinet All_Byte_B1 7 Allarme comunicazione profinet - Modulo IOlink 1(UB) {A231.1}
17 Alarm-02-0 profinet All_Byte_B2 0 Allarme comunicazione profinet - Modulo IOlink 1.1(TU) {A690.1}
18 Alarm-02-1 profinet All_Byte_B2 1 Allarme comunicazione profinet - Modulo IOlink 2.1(TU) {A690.2}
19 Alarm-02-2 profinet All_Byte_B2 2 Allarme comunicazione profinet - Modulo IOlink 3.1(TU) {A690.3}
20 Alarm-02-3 profinet All_Byte_B2 3 Allarme comunicazione profinet - Modulo IOlink 1.1(LB) {A706.1}
21 Alarm-02-4 profinet All_Byte_B2 4 Allarme comunicazione profinet - Modulo IOlink 2.1(LB) {A706.2}
22 Alarm-02-5 profinet All_Byte_B2 5 Allarme comunicazione profinet - Modulo IOlink 3.1(LB) {A706.3}
23 Alarm-02-6 profinet All_Byte_B2 6 Allarme comunicazione profinet - Modulo IOlink 6.1(LB) {A706.6}
24 Alarm-02-7 profinet All_Byte_B2 7 Allarme comunicazione profinet - Modulo IOlink 1.1(UB) {A731.1}
25 Alarm-03-0 profinet All_Byte_B3 0 Allarme comunicazione profinet - Encoder ruota 1 sinistra
26 Alarm-03-1 profinet All_Byte_B3 1 Allarme comunicazione profinet - Encoder ruota 2 sinistra
27 Alarm-03-2 profinet All_Byte_B3 2 Allarme comunicazione profinet - Encoder ruota 3 sinistra
28 Alarm-03-3 profinet All_Byte_B3 3 Allarme comunicazione profinet - Encoder ruota 4 sinistra
29 Alarm-03-4 profinet All_Byte_B3 4 Allarme comunicazione profinet - Encoder ruota 5 sinistra
30 Alarm-03-5 profinet All_Byte_B3 5 Allarme comunicazione profinet - Encoder ruota 6 sinistra
31 Alarm-03-6 profinet All_Byte_B3 6 Allarme comunicazione profinet - Encoder ruota 7 sinistra
32 Alarm-03-7 profinet All_Byte_B3 7 Allarme comunicazione profinet - Encoder ruota 8 sinistra
33 Alarm-04-0 profinet All_Byte_B4 0 Allarme comunicazione profinet - Encoder ruota 1 destra
34 Alarm-04-1 profinet All_Byte_B4 1 Allarme comunicazione profinet - Encoder ruota 2 destra
35 Alarm-04-2 profinet All_Byte_B4 2 Allarme comunicazione profinet - Encoder ruota 3 destra
36 Alarm-04-3 profinet All_Byte_B4 3 Allarme comunicazione profinet - Encoder ruota 4 destra
37 Alarm-04-4 profinet All_Byte_B4 4 Allarme comunicazione profinet - Encoder ruota 5 destra
38 Alarm-04-5 profinet All_Byte_B4 5 Allarme comunicazione profinet - Encoder ruota 6 destra
39 Alarm-04-6 profinet All_Byte_B4 6 Allarme comunicazione profinet - Encoder ruota 7 destra
40 Alarm-04-7 profinet All_Byte_B4 7 Allarme comunicazione profinet - Encoder ruota 8 destra
41 Alarm-05-0 profinet All_Byte_B5 0 Allarme comunicazione profinet - encoder carrello 1
42 Alarm-05-1 profinet All_Byte_B5 1 Allarme comunicazione profinet - encoder carrello 2
43 Alarm-05-2 profinet All_Byte_B5 2 Allarme comunicazione profinet - encoder carrello 3
44 Alarm-05-3 profinet All_Byte_B5 3 Allarme comunicazione profinet - encoder carrello 4
45 Alarm-05-4 profinet All_Byte_B5 4 Allarme comunicazione profinet - encoder carrello 5
46 Alarm-05-5 profinet All_Byte_B5 5 Allarme comunicazione profinet - encoder carrello 6
47 Alarm-05-6 profinet All_Byte_B5 6 Allarme comunicazione profinet - encoder carrello 7
48 Alarm-05-7 profinet All_Byte_B5 7 Allarme comunicazione profinet - encoder carrello 8
49 Alarm-06-0 profinet All_Byte_B6 0 Allarme comunicazione profinet - encoder argano 1
50 Alarm-06-1 profinet All_Byte_B6 1 Allarme comunicazione profinet - encoder argano 2
51 Alarm-06-2 profinet All_Byte_B6 2 Allarme comunicazione profinet - encoder argano 3
52 Alarm-06-3 profinet All_Byte_B6 3 Allarme comunicazione profinet - encoder argano 4
53 Alarm-06-4 profinet All_Byte_B6 4 Allarme comunicazione profinet - encoder argano 5
54 Alarm-06-5 profinet All_Byte_B6 5 Allarme comunicazione profinet - encoder argano 6
55 Alarm-06-6 profinet All_Byte_B6 6 Allarme comunicazione profinet - encoder argano 7
56 Alarm-06-7 profinet All_Byte_B6 7 Allarme comunicazione profinet - encoder argano 8
57 Alarm-07-0 message All_Byte_B7 0 Pulsante emergenza premuto su ruota 1 SX
58 Alarm-07-1 message All_Byte_B7 1 Pulsante emergenza premuto su ruota 2 SX
59 Alarm-07-2 message All_Byte_B7 2 Pulsante emergenza premuto su ruota 3 SX
60 Alarm-07-3 message All_Byte_B7 3 Pulsante emergenza premuto su ruota 4 SX
61 Alarm-07-4 message All_Byte_B7 4 Pulsante emergenza premuto su ruota 5 SX
62 Alarm-07-5 message All_Byte_B7 5 Pulsante emergenza premuto su ruota 6 SX
63 Alarm-07-6 message All_Byte_B7 6 Pulsante emergenza premuto su ruota 7 SX
64 Alarm-07-7 message All_Byte_B7 7 Pulsante emergenza premuto su ruota 8 SX
65 Alarm-08-0 message All_Byte_B8 0 Pulsante emergenza premuto su ruota 1 DX
66 Alarm-08-1 message All_Byte_B8 1 Pulsante emergenza premuto su ruota 2 DX
67 Alarm-08-2 message All_Byte_B8 2 Pulsante emergenza premuto su ruota 3 DX
68 Alarm-08-3 message All_Byte_B8 3 Pulsante emergenza premuto su ruota 4 DX
69 Alarm-08-4 message All_Byte_B8 4 Pulsante emergenza premuto su ruota 5 DX
70 Alarm-08-5 message All_Byte_B8 5 Pulsante emergenza premuto su ruota 6 DX
71 Alarm-08-6 message All_Byte_B8 6 Pulsante emergenza premuto su ruota 7 DX
72 Alarm-08-7 message All_Byte_B8 7 Pulsante emergenza premuto su ruota 8 DX
73 Alarm-09-0 message All_Byte_B9 0 Pulsante emergenza premuto su QE GT1
74 Alarm-09-1 message All_Byte_B9 1 Pulsante emergenza premuto su QE GT2
75 Alarm-09-2 message All_Byte_B9 2 Radiocomando spento o fungo di emergenza premuto
76 Alarm-09-3 message All_Byte_B9 3
77 Alarm-09-4 message All_Byte_B9 4
78 Alarm-09-5 message All_Byte_B9 5
79 Alarm-09-6 message All_Byte_B9 6
80 Alarm-09-7 message All_Byte_B9 7
81 Alarm-10-0 message All_Byte_B10 0 Filtro Intasato 1 - GT1
82 Alarm-10-1 message All_Byte_B10 1 Filtro Intasato 2 - GT1
83 Alarm-10-2 message All_Byte_B10 2 Filtro Intasato 3 - GT1
84 Alarm-10-3 message All_Byte_B10 3 Filtro Intasato 4 - GT1
85 Alarm-10-4 message All_Byte_B10 4 Filtro Intasato 5 - GT1
86 Alarm-10-5 message All_Byte_B10 5 Filtro Intasato 6 - GT1
87 Alarm-10-6 hydraulic All_Byte_B10 6 Massima temperatura olio - GT1
88 Alarm-10-7 hydraulic All_Byte_B10 7 Livello minimo olio - GT1
89 Alarm-11-0 hydraulic All_Byte_B11 0 Massima pressione sterzo - GT1
90 Alarm-11-1 hydraulic All_Byte_B11 1 Allarme sensori di pressione su ralle
91 Alarm-11-2 hydraulic All_Byte_B11 2 GT1 - Sensore livello olio - Massimo livello, Stop movimenti
92 Alarm-11-3 hydraulic All_Byte_B11 3
93 Alarm-11-4 message All_Byte_B11 4 Allarme Riserva diesel motore GT1
94 Alarm-11-5 hydraulic All_Byte_B11 5 Anomalia motore diesel GT1
95 Alarm-11-6 hydraulic All_Byte_B11 6 Timeout disattivazione frizione - inserimento pompe su GT1
96 Alarm-11-7 hydraulic All_Byte_B11 7
97 Alarm-12-0 hydraulic All_Byte_B12 0 GT1 - Sensore livello olio - Nessun segnale
98 Alarm-12-1 hydraulic All_Byte_B12 1 GT1 - Sensore pressione freno - Nessun segnale
99 Alarm-12-2 hydraulic All_Byte_B12 2 GT1 - Sensore pressione traslazione - Nessun segnale
100 Alarm-12-3 hydraulic All_Byte_B12 3 GT1 - Sensore pressione PVG1 - Nessun segnale
101 Alarm-12-4 hydraulic All_Byte_B12 4 GT1 - Sensore pressione PVG2 - Nessun segnale
102 Alarm-12-5 hydraulic All_Byte_B12 5 GT1 - Sensore pressione PVG3 - Nessun segnale
103 Alarm-12-6 hydraulic All_Byte_B12 6 GT1 - Sensore pressione PVG4 - Nessun segnale
104 Alarm-12-7 hydraulic All_Byte_B12 7 GT1 - Sensore pressione PVG5 - Nessun segnale
105 Alarm-13-0 hydraulic All_Byte_B13 0
106 Alarm-13-1 hydraulic All_Byte_B13 1
107 Alarm-13-2 hydraulic All_Byte_B13 2
108 Alarm-13-3 hydraulic All_Byte_B13 3
109 Alarm-13-4 hydraulic All_Byte_B13 4
110 Alarm-13-5 hydraulic All_Byte_B13 5 GT1 - Sensore pressione pompa 2 - Nessun segnale
111 Alarm-13-6 hydraulic All_Byte_B13 6 GT1 - Sensore pressione pompa 3 - Nessun segnale
112 Alarm-13-7 hydraulic All_Byte_B13 7 GT1 - Sensore pressione pompa 4 - Nessun segnale
113 Alarm-14-0 hydraulic All_Byte_B14 0 GT1 - Sensore pressione pompa 5 - Nessun segnale
114 Alarm-14-1 hydraulic All_Byte_B14 1
115 Alarm-14-2 hydraulic All_Byte_B14 2
116 Alarm-14-3 hydraulic All_Byte_B14 3
117 Alarm-14-4 hydraulic All_Byte_B14 4
118 Alarm-14-5 hydraulic All_Byte_B14 5
119 Alarm-14-6 hydraulic All_Byte_B14 6
120 Alarm-14-7 hydraulic All_Byte_B14 7
121 Alarm-15-0 message All_Byte_B15 0 Filtro Intasato 1 - GT2
122 Alarm-15-1 message All_Byte_B15 1 Filtro Intasato 2 - GT2
123 Alarm-15-2 message All_Byte_B15 2 Filtro Intasato 3 - GT2
124 Alarm-15-3 message All_Byte_B15 3 Filtro Intasato 4 - GT2
125 Alarm-15-4 message All_Byte_B15 4 Filtro Intasato 5 - GT2
126 Alarm-15-5 message All_Byte_B15 5 Filtro Intasato 6 - GT2
127 Alarm-15-6 message All_Byte_B15 6
128 Alarm-15-7 hydraulic All_Byte_B15 7 Livello minimo olio - GT2
129 Alarm-16-0 hydraulic All_Byte_B16 0 Massima pressione sterzo - GT2
130 Alarm-16-1 hydraulic All_Byte_B16 1
131 Alarm-16-2 hydraulic All_Byte_B16 2 GT2 - Sensore livello olio - Massimo livello, Stop movimenti
132 Alarm-16-3 hydraulic All_Byte_B16 3
133 Alarm-16-4 hydraulic All_Byte_B16 4 Riserva diesel motore GT2
134 Alarm-16-5 hydraulic All_Byte_B16 5 Anomalia motore diesel GT2
135 Alarm-16-6 hydraulic All_Byte_B16 6 Timeout disattivazione frizione - inserimento pompe su GT2
136 Alarm-16-7 hydraulic All_Byte_B16 7
137 Alarm-17-0 hydraulic All_Byte_B17 0 GT2 - Sensore livello olio - Nessun segnale
138 Alarm-17-1 hydraulic All_Byte_B17 1 GT2 - Sensore pressione freno - Nessun segnale
139 Alarm-17-2 hydraulic All_Byte_B17 2 GT2 - Sensore pressione traslazione - Nessun segnale
140 Alarm-17-3 hydraulic All_Byte_B17 3 GT2 - Sensore pressione PVG1 - Nessun segnale
141 Alarm-17-4 hydraulic All_Byte_B17 4 GT2 - Sensore pressione PVG2 - Nessun segnale
142 Alarm-17-5 hydraulic All_Byte_B17 5 GT2 - Sensore pressione PVG3 - Nessun segnale
143 Alarm-17-6 hydraulic All_Byte_B17 6 GT2 - Sensore pressione PVG4 - Nessun segnale
144 Alarm-17-7 hydraulic All_Byte_B17 7 GT2 - Sensore pressione PVG5 - Nessun segnale
145 Alarm-18-0 hydraulic All_Byte_B18 0
146 Alarm-18-1 hydraulic All_Byte_B18 1
147 Alarm-18-2 hydraulic All_Byte_B18 2
148 Alarm-18-3 hydraulic All_Byte_B18 3
149 Alarm-18-4 hydraulic All_Byte_B18 4
150 Alarm-18-5 hydraulic All_Byte_B18 5 GT2 - Sensore pressione pompa 2 - Nessun segnale
151 Alarm-18-6 hydraulic All_Byte_B18 6 GT2 - Sensore pressione pompa 3 - Nessun segnale
152 Alarm-18-7 hydraulic All_Byte_B18 7 GT2 - Sensore pressione pompa 4 - Nessun segnale
153 Alarm-19-0 hydraulic All_Byte_B19 0 GT2 - Sensore pressione pompa 5 - Nessun segnale
154 Alarm-19-1 hydraulic All_Byte_B19 1
155 Alarm-19-2 hydraulic All_Byte_B19 2
156 Alarm-19-3 hydraulic All_Byte_B19 3
157 Alarm-19-4 hydraulic All_Byte_B19 4
158 Alarm-19-5 hydraulic All_Byte_B19 5
159 Alarm-19-6 hydraulic All_Byte_B19 6
160 Alarm-19-7 hydraulic All_Byte_B19 7
161 Alarm-20-0 positioning All_Byte_B20 0 Ruota fuori finestra 1 SX
162 Alarm-20-1 positioning All_Byte_B20 1 Ruota fuori finestra 2 SX
163 Alarm-20-2 positioning All_Byte_B20 2 Ruota fuori finestra 3 SX
164 Alarm-20-3 positioning All_Byte_B20 3 Ruota fuori finestra 4 SX
165 Alarm-20-4 positioning All_Byte_B20 4 Ruota fuori finestra 5 SX
166 Alarm-20-5 positioning All_Byte_B20 5 Ruota fuori finestra 6 SX
167 Alarm-20-6 positioning All_Byte_B20 6 Ruota fuori finestra 7 SX
168 Alarm-20-7 positioning All_Byte_B20 7 Ruota fuori finestra 8 SX
169 Alarm-21-0 positioning All_Byte_B21 0 Ruota fuori finestra 1 DX
170 Alarm-21-1 positioning All_Byte_B21 1 Ruota fuori finestra 2 DX
171 Alarm-21-2 positioning All_Byte_B21 2 Ruota fuori finestra 3 DX
172 Alarm-21-3 positioning All_Byte_B21 3 Ruota fuori finestra 4 DX
173 Alarm-21-4 positioning All_Byte_B21 4 Ruota fuori finestra 5 DX
174 Alarm-21-5 positioning All_Byte_B21 5 Ruota fuori finestra 6 DX
175 Alarm-21-6 positioning All_Byte_B21 6 Ruota fuori finestra 7 DX
176 Alarm-21-7 positioning All_Byte_B21 7 Ruota fuori finestra 8 DX
177 Alarm-22-0 positioning All_Byte_B22 0
178 Alarm-22-1 positioning All_Byte_B22 1 Allarme fuori finestra 5°
179 Alarm-22-2 positioning All_Byte_B22 2 Allarme fuori finestra 10°
180 Alarm-22-3 positioning All_Byte_B22 3
181 Alarm-22-4 positioning All_Byte_B22 4
182 Alarm-22-5 positioning All_Byte_B22 5
183 Alarm-22-6 positioning All_Byte_B22 6
184 Alarm-22-7 positioning All_Byte_B22 7
185 Alarm-23-0 wind All_Byte_B23 0 Allarme trasduttore velocità vento
186 Alarm-23-1 wind All_Byte_B23 1 Allarme anemometro soglia 1
187 Alarm-23-2 wind All_Byte_B23 2 Allarme anemometro soglia 2
188 Alarm-23-3 wind;Bypass All_Byte_B23 3 Bypass inserito - Anemometro
189 Alarm-23-4 wind All_Byte_B23 4
190 Alarm-23-5 wind All_Byte_B23 5
191 Alarm-23-6 wind All_Byte_B23 6
192 Alarm-23-7 wind All_Byte_B23 7
193 Alarm-24-0 positioning All_Byte_B24 0 Posizione argano 1 fuori finestra
194 Alarm-24-1 positioning All_Byte_B24 1 Posizione argano 2 fuori finestra
195 Alarm-24-2 positioning All_Byte_B24 2 Posizione argano 3 fuori finestra
196 Alarm-24-3 positioning All_Byte_B24 3 Posizione argano 4 fuori finestra
197 Alarm-24-4 positioning All_Byte_B24 4 Posizione argano 5 fuori finestra
198 Alarm-24-5 positioning All_Byte_B24 5 Posizione argano 6 fuori finestra
199 Alarm-24-6 positioning All_Byte_B24 6 Posizione argano 7 fuori finestra
200 Alarm-24-7 positioning All_Byte_B24 7 Posizione argano 8 fuori finestra
201 Alarm-25-0 positioning All_Byte_B25 0 Posizione Carrello 1 fuori finestra
202 Alarm-25-1 positioning All_Byte_B25 1 Posizione Carrello 2 fuori finestra
203 Alarm-25-2 positioning All_Byte_B25 2 Posizione Carrello 3 fuori finestra
204 Alarm-25-3 positioning All_Byte_B25 3 Posizione Carrello 4 fuori finestra
205 Alarm-25-4 positioning All_Byte_B25 4 Posizione Carrello 5 fuori finestra
206 Alarm-25-5 positioning All_Byte_B25 5 Posizione Carrello 6 fuori finestra
207 Alarm-25-6 positioning All_Byte_B25 6 Posizione Carrello 7 fuori finestra
208 Alarm-25-7 positioning All_Byte_B25 7 Posizione Carrello 8 fuori finestra
209 Alarm-26-0 Bypass All_Byte_B26 0 Bypass inserito - encoder posizione - Argano 1
210 Alarm-26-1 Bypass All_Byte_B26 1 Bypass inserito - encoder posizione - Argano 2
211 Alarm-26-2 Bypass All_Byte_B26 2 Bypass inserito - encoder posizione - Argano 3
212 Alarm-26-3 Bypass All_Byte_B26 3 Bypass inserito - encoder posizione - Argano 4
213 Alarm-26-4 Bypass All_Byte_B26 4 Bypass inserito - encoder posizione - Argano 5
214 Alarm-26-5 Bypass All_Byte_B26 5 Bypass inserito - encoder posizione - Argano 6
215 Alarm-26-6 Bypass All_Byte_B26 6 Bypass inserito - encoder posizione - Argano 7
216 Alarm-26-7 Bypass All_Byte_B26 7 Bypass inserito - encoder posizione - Argano 8
217 Alarm-27-0 weighting All_Byte_B27 0 Guasto celle canale 1
218 Alarm-27-1 weighting All_Byte_B27 1 Guasto celle canale 2
219 Alarm-27-2 weighting All_Byte_B27 2 Guasto celle canale 3
220 Alarm-27-3 weighting All_Byte_B27 3 Guasto celle canale 4
221 Alarm-27-4 weighting All_Byte_B27 4 Allarme sovraccarico argani 7-8
222 Alarm-27-5 weighting All_Byte_B27 5 Allarme sovraccarico argani 5-6
223 Alarm-27-6 weighting All_Byte_B27 6 Allarme sovraccarico argani 3-4
224 Alarm-27-7 weighting All_Byte_B27 7 Allarme sovraccarico argani 1-2
225 Alarm-28-0 weighting All_Byte_B28 0 Allarme sovraccarico somma totale
226 Alarm-28-1 weighting All_Byte_B28 1 Stop sollevamento da controllo baricentro
227 Alarm-28-2 weighting All_Byte_B28 2
228 Alarm-28-3 weighting All_Byte_B28 3
229 Alarm-28-4 weighting All_Byte_B28 4
230 Alarm-28-5 weighting All_Byte_B28 5
231 Alarm-28-6 weighting All_Byte_B28 6
232 Alarm-28-7 weighting All_Byte_B28 7
233 Alarm-29-0 All_Byte_B29 0
234 Alarm-29-1 All_Byte_B29 1
235 Alarm-29-2 All_Byte_B29 2
236 Alarm-29-3 All_Byte_B29 3
237 Alarm-29-4 All_Byte_B29 4
238 Alarm-29-5 All_Byte_B29 5
239 Alarm-29-6 All_Byte_B29 6
240 Alarm-29-7 All_Byte_B29 7
241 Alarm-30-0 bypass All_Byte_B30 0 Bypass inserito - sensore pressione - Ruota SX 1
242 Alarm-30-1 bypass All_Byte_B30 1 Bypass inserito - sensore pressione - Ruota SX 2
243 Alarm-30-2 bypass All_Byte_B30 2 Bypass inserito - sensore pressione - Ruota SX 3
244 Alarm-30-3 bypass All_Byte_B30 3 Bypass inserito - sensore pressione - Ruota SX 4
245 Alarm-30-4 bypass All_Byte_B30 4 Bypass inserito - sensore pressione - Ruota SX 5
246 Alarm-30-5 bypass All_Byte_B30 5 Bypass inserito - sensore pressione - Ruota SX 6
247 Alarm-30-6 bypass All_Byte_B30 6 Bypass inserito - sensore pressione - Ruota SX 7
248 Alarm-30-7 bypass All_Byte_B30 7 Bypass inserito - sensore pressione - Ruota SX 8
249 Alarm-31-0 bypass All_Byte_B31 0 Bypass inserito - sensore pressione - Ruota DX 1
250 Alarm-31-1 bypass All_Byte_B31 1 Bypass inserito - sensore pressione - Ruota DX 2
251 Alarm-31-2 bypass All_Byte_B31 2 Bypass inserito - sensore pressione - Ruota DX 3
252 Alarm-31-3 bypass All_Byte_B31 3 Bypass inserito - sensore pressione - Ruota DX 4
253 Alarm-31-4 bypass All_Byte_B31 4 Bypass inserito - sensore pressione - Ruota DX 5
254 Alarm-31-5 bypass All_Byte_B31 5 Bypass inserito - sensore pressione - Ruota DX 6
255 Alarm-31-6 bypass All_Byte_B31 6 Bypass inserito - sensore pressione - Ruota DX 7
256 Alarm-31-7 bypass All_Byte_B31 7 Bypass inserito - sensore pressione - Ruota DX 8
257 Alarm-32-0 bypass All_Byte_B32 0 Bypass inserito - sensore posizione - Carrello 1
258 Alarm-32-1 bypass All_Byte_B32 1 Bypass inserito - sensore posizione - Carrello 2
259 Alarm-32-2 bypass All_Byte_B32 2 Bypass inserito - sensore posizione - Carrello 3
260 Alarm-32-3 bypass All_Byte_B32 3 Bypass inserito - sensore posizione - Carrello 4
261 Alarm-32-4 bypass All_Byte_B32 4 Bypass inserito - sensore posizione - Carrello 5
262 Alarm-32-5 bypass All_Byte_B32 5 Bypass inserito - sensore posizione - Carrello 6
263 Alarm-32-6 bypass All_Byte_B32 6 Bypass inserito - sensore posizione - Carrello 7
264 Alarm-32-7 bypass All_Byte_B32 7 Bypass inserito - sensore posizione - Carrello 8
265 Alarm-33-0 Bypass All_Byte_B33 0 Bypass inserito - encoder posizione - Carrello 1
266 Alarm-33-1 Bypass All_Byte_B33 1 Bypass inserito - encoder posizione - Carrello 2
267 Alarm-33-2 Bypass All_Byte_B33 2 Bypass inserito - encoder posizione - Carrello 3
268 Alarm-33-3 Bypass All_Byte_B33 3 Bypass inserito - encoder posizione - Carrello 4
269 Alarm-33-4 Bypass All_Byte_B33 4 Bypass inserito - encoder posizione - Carrello 5
270 Alarm-33-5 Bypass All_Byte_B33 5 Bypass inserito - encoder posizione - Carrello 6
271 Alarm-33-6 Bypass All_Byte_B33 6 Bypass inserito - encoder posizione - Carrello 7
272 Alarm-33-7 Bypass All_Byte_B33 7 Bypass inserito - encoder posizione - Carrello 8
273 Alarm-34-0 bypass All_Byte_B34 0 Bypass inserito - finecorsa posizione - Argano 1
274 Alarm-34-1 bypass All_Byte_B34 1 Bypass inserito - finecorsa posizione - Argano 2
275 Alarm-34-2 bypass All_Byte_B34 2 Bypass inserito - finecorsa posizione - Argano 3
276 Alarm-34-3 bypass All_Byte_B34 3 Bypass inserito - finecorsa posizione - Argano 4
277 Alarm-34-4 bypass All_Byte_B34 4 Bypass inserito - finecorsa posizione - Argano 5
278 Alarm-34-5 bypass All_Byte_B34 5 Bypass inserito - finecorsa posizione - Argano 6
279 Alarm-34-6 bypass All_Byte_B34 6 Bypass inserito - finecorsa posizione - Argano 7
280 Alarm-34-7 bypass All_Byte_B34 7 Bypass inserito - finecorsa posizione - Argano 8
281 Alarm-35-0 bypass All_Byte_B35 0 Bypass inserito - controllo posizione baricentro
282 Alarm-35-0 bypass All_Byte_B35 1
283 Alarm-35-0 bypass All_Byte_B35 2
284 Alarm-35-0 bypass All_Byte_B35 3
285 Alarm-35-0 bypass All_Byte_B35 4
286 Alarm-35-0 bypass All_Byte_B35 5
287 Alarm-35-0 bypass All_Byte_B35 6
288 Alarm-35-0 bypass All_Byte_B35 7
289 Alarm-36-0 All_Byte_B36 0
290 Alarm-36-1 All_Byte_B36 1
291 Alarm-36-2 All_Byte_B36 2
292 Alarm-36-3 All_Byte_B36 3
293 Alarm-36-4 All_Byte_B36 4
294 Alarm-36-5 All_Byte_B36 5
295 Alarm-36-6 All_Byte_B36 6
296 Alarm-36-7 All_Byte_B36 7
297 Alarm-37-0 maintenance All_Byte_B37 0 Richiesta manutenzione traslazione
298 Alarm-37-1 maintenance All_Byte_B37 1 Richiesta manutenzione sterzatura
299 Alarm-37-2 maintenance All_Byte_B37 2 Richiesta manutenzione motore GT1
300 Alarm-37-3 maintenance All_Byte_B37 3 Richiesta manutenzione motore GT2
301 Alarm-37-4 maintenance All_Byte_B37 4 Richiesta manutenzione argani
302 Alarm-37-5 maintenance All_Byte_B37 5 Richiesta manutenzione carrelli
303 Alarm-37-6 All_Byte_B37 6
304 Alarm-37-7 All_Byte_B37 7
305 n/a n/a n/a n/a
306 n/a n/a n/a n/a
307 n/a n/a n/a n/a
308 n/a n/a n/a n/a
309 n/a n/a n/a n/a
310 n/a n/a n/a n/a
311 n/a n/a n/a n/a
+1
View File
@@ -0,0 +1 @@
pip install inquirer (pacchetto per gestire la scelta del file di lettura)