139 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
Samuele E. Locatelli a6dff6dc0b Merge remote-tracking branch 'origin/develop' into RemoteDebug 2022-09-07 11:12:51 +02:00
Samuele Locatelli 6d06c601a8 Merge branch 'Feature/FanucDoppioPallet' into develop 2022-09-07 11:12:16 +02:00
Samuele Locatelli 7c84d739fb Fix conf fanuc DP Colcom L018 2022-09-07 11:12:02 +02:00
Samuele Locatelli 49312dd181 Eliminazione fanuc DP (NON serve) 2022-09-07 11:09:59 +02:00
Samuele Locatelli 7e66ebb79a Colcom L018:
- aggiunti bit x doppio pallet e cambiate machcine ingresso
2022-09-06 19:23:03 +02:00
Samuele Locatelli 8ee2f3b9c4 Conf originale L18 colcom (NO DP signals) 2022-09-06 19:22:36 +02:00
Samuele Locatelli 9d320ae451 Inizio setup classe fanuc DP x gestione DOppioPallet 2022-09-06 19:09:35 +02:00
Samuele Locatelli d388c420ed Merge tag 'OpcUaOmp' into develop
Aggiunta gestione debug remoto x OMP
2022-09-06 17:56:42 +02:00
Samuele Locatelli d2aa632a89 Merge branch 'release/OpcUaOmp' 2022-09-06 17:56:25 +02:00
Samuele Locatelli 0199669847 COpe typo fix 2022-09-06 17:43:57 +02:00
Samuele Locatelli f85c47fe24 Reord classe ToMapo 2022-09-06 17:40:30 +02:00
Samuele Locatelli 3620822e83 Merge branch 'RemoteDebug' into develop 2022-09-06 17:29:37 +02:00
Samuele E. Locatelli 14740640fb COmpletata aggiunta metodi x OMP (da testare) 2022-09-06 17:27:55 +02:00
Samuele E. Locatelli 3b5e76d72a Continuo fix OMP 2022-09-06 17:22:45 +02:00
Samuele E. Locatelli eb8cb3cfb5 update bat scripts 2022-09-06 15:05:49 +02:00
Samuele E. Locatelli 821a2c3fcf update conf x valore contapezzi/pz req 2022-09-06 12:46:53 +02:00
Samuele E. Locatelli aded6e2020 timeout a 60 min x client OPC-UA 2022-09-06 12:40:54 +02:00
Samuele E. Locatelli 5029049835 Modifica conf x OMP FInassi 2022-09-06 12:40:31 +02:00
Samuele E. Locatelli 51227605f2 Update conf finassi x test remoto 2022-09-05 17:08:14 +02:00
Samuele E. Locatelli 7cfa69e889 Update x gestione debug remoto da conf progetto 2022-09-05 16:40:36 +02:00
Samuele E. Locatelli f40044ff31 Fix configurazione finazzi/OMP 2022-09-05 16:40:24 +02:00
Samuele Locatelli e2c905d113 Merge branch 'develop' of https://gitlab.steamware.net/steamware/Mapo-IOB-WIN into develop 2022-09-05 14:53:51 +02:00
Samuele E. Locatelli a399761674 Merge branch 'master' into develop 2022-09-05 12:41:00 +02:00
Samuele E. Locatelli c336f7504d Aggiunta preliminare OMP 2022-09-05 12:40:31 +02:00
Samuele Locatelli c3c9addbef Merge branch 'develop' of https://gitlab.steamware.net/steamware/Mapo-IOB-WIN into develop 2022-07-29 17:53:16 +02:00
Samuele E. Locatelli b7fb86f94f Merge branch 'develop' 2022-07-29 16:51:26 +02:00
Samuele E. Locatelli b861daaf12 Helpi
- ok scrittura string
- ok scrittura NUM
2022-07-29 16:50:55 +02:00
Samuele E. Locatelli 937fffb2c4 update x test scrittura string 2022-07-29 16:07:26 +02:00
Samuele E. Locatelli 503d2ecfa3 Merge branch 'develop' 2022-07-29 13:33:25 +02:00
Samuele E. Locatelli a200f1455e Update SDK Mapo, valori reversed LH x Helpi 2022-07-29 13:30:31 +02:00
Samuele E. Locatelli 9822f43894 Merge branch 'master' into develop 2022-07-29 11:10:00 +02:00
Samuele E. Locatelli eae1d51337 Update x gestione lettura string 2022-07-29 11:08:38 +02:00
Samuele E. Locatelli 9f8944876d update ModBus x lettura string 2022-07-28 19:15:24 +02:00
Samuele E. Locatelli 4941dc3fdc deploy remoto x FINASSI (test) 2022-07-28 19:15:14 +02:00
Samuele E. Locatelli 852bbcb29a update conf finassi x debug remoto 2022-07-28 19:15:02 +02:00
Samuele E. Locatelli 0f6f32a5a0 Aggiunta util x conversione dato EPOCH 2022-07-28 19:14:49 +02:00
Samuele Locatelli 06d25078e6 Merge tag 'ModbusHelpiDebug01' into develop
update log x helpi + modbus
2022-07-27 19:01:06 +02:00
Samuele Locatelli ace3ef79c1 Merge branch 'release/ModbusHelpiDebug01' 2022-07-27 19:00:56 +02:00
Samuele Locatelli e162c2a8af update x migliorare log helpi... 2022-07-27 18:59:09 +02:00
Samuele Locatelli 9baae29627 Merge tag 'ModbusLogReadDetailed' into develop
Log errori read modbus + dettagliato
2022-07-27 12:42:56 +02:00
Samuele Locatelli 845c32d56f Merge branch 'release/ModbusLogReadDetailed' 2022-07-27 12:42:43 +02:00
Samuele Locatelli 04734ddf46 Update x test lettura helpi che cade in lettura 2022-07-27 12:42:18 +02:00
Samuele Locatelli 3f995027b5 Inizio obj OpcUaSiemens OMP (FARE!!!) 2022-07-27 12:39:12 +02:00
Samuele Locatelli 46b50fac5b Update parametri simula (minDeltaSec) 2022-07-27 12:38:52 +02:00
Samuele Locatelli 657c90061f Update conf finassi/Helpi 2022-07-27 12:38:31 +02:00
Samuele Locatelli fffb0c712e update conf aprametri Fanuc aux x Jetco 2022-07-27 12:38:19 +02:00
Samuele Locatelli e8f5044972 Merge tag 'MinDeltaSecParametrico' into develop
Update: gestione delta sec parametrico + fix watchdog (ogni tentativo
--> update lastPLC)
2022-07-14 16:31:15 +02:00
Samuele Locatelli b5d214b437 Merge branch 'release/MinDeltaSecParametrico' 2022-07-14 16:30:47 +02:00
Samuele Locatelli cde83c36b0 Sistemato PING/watchdog x aggiornare lastPLC sempre 2022-07-14 16:30:18 +02:00
Samuele Locatelli 7c83c314ea Gestione delta secondi parametrico 2022-07-14 16:29:32 +02:00
Samuele Locatelli 42c50cad0c Aggiunta parametro x minimo delta sec 2022-07-14 16:29:24 +02:00
Samuele Locatelli 77de6722f3 Refresh conf x errore typo 2022-07-14 16:29:13 +02:00
Samuele Locatelli 6bfb159f19 Merge tag 'TestRefreshIobManWin' into develop
Cambio condizioni calcolo aggiornamento
2022-07-14 16:00:07 +02:00
Samuele Locatelli cbc6de2cca Merge branch 'release/TestRefreshIobManWin' 2022-07-14 16:00:00 +02:00
Samuele Locatelli 335a877d4d Update condizioni ultimo valore aggiornato 2022-07-14 15:59:24 +02:00
Samuele Locatelli 766fc5eade Merge tag 'UpdateLastPlcSignal' into develop
Update frequenza refresh lastPLC
2022-07-14 15:30:26 +02:00
Samuele Locatelli 1e7b2cd24e Merge branch 'release/UpdateLastPlcSignal' 2022-07-14 15:30:17 +02:00
Samuele Locatelli f009dbef37 IOB-WIN-NEXT:
- Refresh frequenza update lastPLC
- refreh MAN
2022-07-14 15:29:57 +02:00
Samuele Locatelli 81233d0bc4 Merge tag 'FixPlcOkModbus' into develop
Update modalità calcolo lastPlcIn x avere PLCOK prima in modbus
2022-07-14 15:17:13 +02:00
Samuele Locatelli a70d4af729 Merge branch 'release/FixPlcOkModbus' 2022-07-14 15:17:00 +02:00
Samuele Locatelli bbae83a669 UPdate modbus x inviare plcOk prima 2022-07-14 15:16:40 +02:00
Samuele Locatelli 121eacfb6a Merge tag 'UpdateSimDP_ErrorRawJson' into develop
Update classi x fix sim DP
2022-07-14 11:20:12 +02:00
Samuele Locatelli 0928ebe6ec Merge branch 'release/UpdateSimDP_ErrorRawJson' 2022-07-14 11:20:01 +02:00
Samuele Locatelli b4a0333085 fix x accodamento dari RAW:
- errore init IOB
- scambio URL di default
- inviava il dato watchdog sul "canale sbagliato"
2022-07-14 11:19:23 +02:00
Samuele Locatelli e0098e4194 Merge tag 'UpdateCenterfrigoWrite' into develop
Update centerfrigo x scrittura, pronto x test lettura con swap byte +
base addr cambiato
2022-07-13 19:22:36 +02:00
Samuele Locatelli 5a35a2e926 Merge branch 'release/UpdateCenterfrigoWrite' 2022-07-13 19:22:17 +02:00
Samuele Locatelli 8efa8fc1d1 Update vari:
- JObject x invio raw
- gestione RealHL e RealLH in lettura ModBus (test centerfrigo)
2022-07-13 19:21:49 +02:00
Samuele Locatelli fd45ab8180 update SDK x configurazione memorie Centerfrigo
- FLoat BaDc --> RealLH
2022-07-13 19:02:00 +02:00
Samuele Locatelli dbf5a88a4e Merge remote-tracking branch 'origin/Feature/Giacovelli' into develop 2022-07-13 18:31:47 +02:00
S.E.Locatelli c691a677d2 centerfrigo:
- update conf e scrittura real
- è LowHigh (NON HighLow)
- da aggiornare SDK
2022-07-13 18:10:05 +02:00
S.E.Locatelli b55cb314f2 Merge remote-tracking branch 'origin/HEAD' into Feature/Giacovelli 2022-07-13 17:49:30 +02:00
Samuele Locatelli bbe04ea0cb Merge tag 'FixDisplayCOntapezziFanuc' into develop
Fix log contapezzi FANUC
2022-07-12 11:43:24 +02:00
Samuele Locatelli 3a2749d947 Merge branch 'release/FixDisplayCOntapezziFanuc' 2022-07-12 11:43:04 +02:00
Samuele Locatelli 8b34765ad5 Update display contapezzi x FANUC (dopo lettura valori da MACRO) 2022-07-12 11:42:43 +02:00
Samuele Locatelli ebc7afc455 Merge tag 'UpdateAuxMacro' into develop
Update x gestione nuova delle p-code
2022-07-12 11:07:06 +02:00
Samuele Locatelli 3bd9da0949 Merge branch 'release/UpdateAuxMacro' 2022-07-12 11:06:50 +02:00
Samuele Locatelli 11fd84276c Update con nuova libreria FANUC 2022-07-12 11:06:18 +02:00
149 changed files with 12770 additions and 8777 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
+1 -1
View File
@@ -8,7 +8,7 @@
<add key="appNameExt" value="IOB-WIN-NEXT" />
<add key="uiPeriod" value="100" />
<add key="checkPeriod" value="3000" />
<add key="forceCheckPeriodMult" value="15" />
<add key="forceCheckPeriodMult" value="20" />
<add key="autoRestartTimeoutMin" value="15" />
<add key="autoStartProc" value="true" />
<add key="closeOnChildUpdate" value="true" />
+237 -238
View File
@@ -1,20 +1,17 @@
using Newtonsoft.Json;
using RestSharp;
using RestSharp.Serializers.NewtonsoftJson;
using SteamWare.Scheduler;
using SteamWare.IO;
using SteamWare.Logger;
using SteamWare.Scheduler;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Net;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
@@ -24,28 +21,53 @@ namespace IOB_MAN
{
public partial class IOBManPanel : Form
{
#region Private Fields
private const int SW_SHOWMAXIMIZED = 3;
private const int SW_SHOWMINIMIZED = 2;
private const int SW_SHOWNORMAL = 1;
#region Public Fields
/// <summary>
/// Context x sync thread
/// Elenco ARGS (uno per child da avviare)
/// </summary>
private readonly SynchronizationContext synchronizationContext;
public List<string> ArgsList = new List<string>();
#endregion Public Fields
#region Public Constructors
/// <summary>
/// Oggetto semaforico di lock
/// Init classe
/// </summary>
private SemaphoreSlim _sync = new SemaphoreSlim(1);
public IOBManPanel()
{
InitializeComponent();
synchronizationContext = SynchronizationContext.Current;
preInit();
loadConfig();
// fix log...
cbLogLevelMin.SelectedValue = "Info";
setLogLevel("Info");
initTimers();
initControls();
updateStatus();
}
#endregion Public Constructors
#region Public Methods
/// <summary>
/// Binding source degli elementi gestiti..
/// Cerca nell'elenco il processo corrente
/// </summary>
private BindingSource ElencoIOB = new BindingSource();
/// <param name="processlist"></param>
/// <param name="id"></param>
/// <returns></returns>
public static Process myGetProcByID(Process[] processlist, int id)
{
return processlist.FirstOrDefault(pr => pr.Id == id);
}
#endregion Private Fields
#endregion Public Methods
#region Protected Fields
@@ -54,6 +76,11 @@ namespace IOB_MAN
/// </summary>
protected static List<iobAdapt> item2rem = new List<iobAdapt>();
/// <summary>
/// URL di base x l'API di gestione licenze/file upload
/// </summary>
protected string ApiUrl = "";
/// <summary>
/// Ramo applicazione (x update)
/// </summary>
@@ -114,26 +141,21 @@ namespace IOB_MAN
/// </summary>
protected string TargetExe = "";
/// <summary>
/// File target x conf NLog
/// </summary>
protected string TargetNLogConf = "";
/// <summary>
/// Directory log generale x IOB-WIN (dentro ci sono x singoli IOB)
/// </summary>
protected string TargetLogDir = "";
/// <summary>
/// URL di base x l'API di gestione licenze/file upload
/// </summary>
protected string ApiUrl = "";
/// <summary>
/// Name dell'exe da chiamare
/// </summary>
protected string TargetName = "";
/// <summary>
/// File target x conf NLog
/// </summary>
protected string TargetNLogConf = "";
/// <summary>
/// Dataora prossima scadenza riavvio automatico
/// </summary>
@@ -151,39 +173,6 @@ namespace IOB_MAN
#endregion Protected Fields
#region Public Fields
/// <summary>
/// Elenco ARGS (uno per child da avviare)
/// </summary>
public List<string> ArgsList = new List<string>();
#endregion Public Fields
#region Public Constructors
/// <summary>
/// Init classe
/// </summary>
public IOBManPanel()
{
InitializeComponent();
synchronizationContext = SynchronizationContext.Current;
preInit();
loadConfig();
// fix log...
cbLogLevelMin.SelectedValue = "Info";
setLogLevel("Info");
initTimers();
initControls();
updateStatus();
}
#endregion Public Constructors
#region Protected Properties
/// <summary>
@@ -199,6 +188,29 @@ namespace IOB_MAN
#endregion Protected Properties
#region Private Fields
private const int SW_SHOWMAXIMIZED = 3;
private const int SW_SHOWMINIMIZED = 2;
private const int SW_SHOWNORMAL = 1;
/// <summary>
/// Context x sync thread
/// </summary>
private readonly SynchronizationContext synchronizationContext;
/// <summary>
/// Oggetto semaforico di lock
/// </summary>
private SemaphoreSlim _sync = new SemaphoreSlim(1);
/// <summary>
/// Binding source degli elementi gestiti..
/// </summary>
private BindingSource ElencoIOB = new BindingSource();
#endregion Private Fields
#region Private Methods
[DllImport("user32.dll")]
@@ -375,12 +387,155 @@ namespace IOB_MAN
updateStatus();
}
private async void btnSendLog_Click(object sender, EventArgs e)
{
// salvo valori button normali
var stdColor = btnSendLog.BackColor;
var stdText = btnSendLog.Text;
// mostro che sto inviando dati...
btnSendLog.Enabled = false;
btnSendLog.BackColor = Color.OrangeRed;
btnSendLog.Text = "fix directory";
btnSendLog.Refresh();
// svuoto area temp...
string fileName = "LogFiles.zip";
string tempDir = Path.Combine(Application.StartupPath, "temp", "logs");
string zipPath = Path.Combine(Application.StartupPath, "temp", fileName);
if (Directory.Exists(tempDir))
{
Directory.Delete(tempDir, true);
}
// ricreo directory...
Directory.CreateDirectory(tempDir);
// definisco limite temporale alle 21 di 2 gg prima...
DateTime minDate = DateTime.Today.AddHours(-27);
// SOLO SE selezionato in dgv...
string logDir = TargetLogDir;
if (dgvManagedItems.SelectedRows.Count > 0)
{
btnSendLog.Text = "zip start";
btnSendLog.Refresh();
// ciclo su row selezionate
foreach (DataGridViewRow riga in dgvManagedItems.SelectedRows)
{
// verifico che sia già chiuso...
var iobData = (iobAdapt)ElencoIOB[riga.Index];
// calcolo folder
logDir = Path.Combine(TargetLogDir, iobData.CodIOB);
// recupero file odierno
DirectoryInfo dI = new DirectoryInfo(logDir);
var files = dI.GetFiles().Where(i => i.CreationTime >= minDate);
// copio in area temp...
foreach (var file in files)
{
Directory.CreateDirectory(Path.Combine(tempDir, iobData.CodIOB));
file.CopyTo(Path.Combine(tempDir, iobData.CodIOB, file.Name));
}
}
// creo unico ZIP
if (File.Exists(zipPath))
{
File.Delete(zipPath);
}
ZipFile.CreateFromDirectory(tempDir, zipPath);
btnSendLog.Text = "zip end";
btnSendLog.Refresh();
// ciclo di creazione ticket e upload file
try
{
// client chiamate rest
var client = new RestClient(ApiUrl);
client.UseNewtonsoftJson();
SupportRequest newSuppReq = new SupportRequest();
string licensePath = Path.Combine(Application.StartupPath, "CONF", "license.json");
string rawData = "";
if (File.Exists(licensePath))
{
rawData = File.ReadAllText(licensePath);
}
if (!string.IsNullOrEmpty(rawData))
{
// fare: composizione richiesta da parametri chiave
newSuppReq = JsonConvert.DeserializeObject<SupportRequest>(rawData);
}
else
{
string hostName = utils.machineName;
string listIP = string.Join(", ", utils.machineIp);
// genero il ticket
newSuppReq = new SupportRequest()
{
CodApp = "MAPO-IOB-WIN-NEXT",
CodImp = "",
CodInst = "SteamWare",
ContactEmail = "info@steamware.net",
ContactName = "Default Config",
ContactPhone = "035-460560",
MasterKey = "a3BRQz/1B34uvvcDoE/D38ssH/c/KSsjpn39wZsxOVsck9rGnBkF3xfUnj3edYIl",
ReqBody = $"File Upload - MISSING license file | machine: {utils.machineName} | IP: {listIP}",
Tipo = TipologiaTicket.FileUpload,
idxSubLic = 0
};
}
btnSendLog.Text = "LogSend start";
btnSendLog.BackColor = Color.DarkOrange;
btnSendLog.Refresh();
var ticketReq = new RestRequest("/api/ticket/sendReq", DataFormat.Json).AddJsonBody(newSuppReq);
var ticketResp = await client.PostAsync<TicketDTO>(ticketReq);
// preparo richiesta x upload file
var fileUploadReq = new RestRequest("/api/filesave/single");
fileUploadReq.AddParameter("ticketId", ticketResp.idxTicket);
fileUploadReq.AddFile("file", zipPath);
// ... infine INVIA file zip che li contiene...
//var fileUploadResp = client.Post(fileUploadReq);
var fileUploadResp = await client.PostAsync<UploadResult>(fileUploadReq);
btnSendLog.Text = "LogSend end";
btnSendLog.BackColor = Color.DarkOliveGreen;
btnSendLog.Refresh();
// elimino folder temporanea
if (Directory.Exists(tempDir))
{
Directory.Delete(tempDir, true);
}
// elimino il file temporaneo...
if (File.Exists(zipPath))
{
File.Delete(zipPath);
}
}
catch (Exception exc)
{
Logging.LogError($"Eccezione in fase gestione REST services{Environment.NewLine}{exc}");
}
}
btnSendLog.BackColor = stdColor;
btnSendLog.Text = stdText;
btnSendLog.Enabled = true;
}
private void btnStartSel_Click(object sender, EventArgs e)
{
// riapro child (SOLO SE non era già aperto...)
apriChildSel();
}
private void cbLogLevelMin_SelectedIndexChanged(object sender, EventArgs e)
{
// aggiornato livelo di log --> chiamo procedura x riscrivere il file conf di NLog
setLogLevel($"{cbLogLevelMin.SelectedItem}");
}
/// <summary>
/// verifica buttons attivi data selezione su gridview...
/// </summary>
@@ -476,7 +631,8 @@ namespace IOB_MAN
IList<iobAdapt> allItems = (IList<iobAdapt>)ElencoIOB.List;
bool needRem = false;
// 2020.02.01 passato chiamata specifica x leggere in 1 sola volta TUTTO elenco processi (x nome)...
// 2020.02.01 passato chiamata specifica x leggere in 1 sola volta TUTTO elenco processi
// (x nome)...
Process[] processList = Process.GetProcessesByName(TargetName);
// ciclo
@@ -729,6 +885,12 @@ namespace IOB_MAN
}
}
private void dgvManagedItems_SelectionChanged(object sender, EventArgs e)
{
checkButtons();
}
private void ElencoIOB_AddingNew(object sender, System.ComponentModel.AddingNewEventArgs e)
{
}
@@ -1093,6 +1255,21 @@ namespace IOB_MAN
updateStatus();
}
private void setLogLevel(string selectedValue)
{
// leggo il file loglevel in resources
string rawData = File.ReadAllText($@"{Application.StartupPath}\Resources\NLog.template.config");
// sostituzione livello minimo da selezione
rawData = rawData.Replace("{{minLevel}}", selectedValue);
// scrivo conf x programma IOB-MAN
File.WriteAllText($@"{Application.StartupPath}\NLog.config", rawData);
// scrivo conf x IOB-WIN gestiti
File.WriteAllText(TargetNLogConf, rawData);
}
/// <summary>
/// Avvio di un child process da parametro ARG
/// </summary>
@@ -1239,183 +1416,5 @@ namespace IOB_MAN
#endregion Private Methods
#region Public Methods
/// <summary>
/// Cerca nell'elenco il processo corrente
/// </summary>
/// <param name="processlist"></param>
/// <param name="id"></param>
/// <returns></returns>
public static Process myGetProcByID(Process[] processlist, int id)
{
return processlist.FirstOrDefault(pr => pr.Id == id);
}
#endregion Public Methods
private void cbLogLevelMin_SelectedIndexChanged(object sender, EventArgs e)
{
// aggiornato livelo di log --> chiamo procedura x riscrivere il file conf di NLog
setLogLevel($"{cbLogLevelMin.SelectedItem}");
}
private void setLogLevel(string selectedValue)
{
// leggo il file loglevel in resources
string rawData = File.ReadAllText($@"{Application.StartupPath}\Resources\NLog.template.config");
// sostituzione livello minimo da selezione
rawData = rawData.Replace("{{minLevel}}", selectedValue);
// scrivo conf x programma IOB-MAN
File.WriteAllText($@"{Application.StartupPath}\NLog.config", rawData);
// scrivo conf x IOB-WIN gestiti
File.WriteAllText(TargetNLogConf, rawData);
}
private void dgvManagedItems_SelectionChanged(object sender, EventArgs e)
{
checkButtons();
}
private async void btnSendLog_Click(object sender, EventArgs e)
{
// salvo valori button normali
var stdColor = btnSendLog.BackColor;
var stdText = btnSendLog.Text;
// mostro che sto inviando dati...
btnSendLog.Enabled = false;
btnSendLog.BackColor = Color.OrangeRed;
btnSendLog.Text = "fix directory";
btnSendLog.Refresh();
// svuoto area temp...
string fileName = "LogFiles.zip";
string tempDir = Path.Combine(Application.StartupPath, "temp", "logs");
string zipPath = Path.Combine(Application.StartupPath, "temp", fileName);
if (Directory.Exists(tempDir))
{
Directory.Delete(tempDir, true);
}
// ricreo directory...
Directory.CreateDirectory(tempDir);
// definisco limite temporale alle 21 di 2 gg prima...
DateTime minDate = DateTime.Today.AddHours(-27);
// SOLO SE selezionato in dgv...
string logDir = TargetLogDir;
if (dgvManagedItems.SelectedRows.Count > 0)
{
btnSendLog.Text = "zip start";
btnSendLog.Refresh();
// ciclo su row selezionate
foreach (DataGridViewRow riga in dgvManagedItems.SelectedRows)
{
// verifico che sia già chiuso...
var iobData = (iobAdapt)ElencoIOB[riga.Index];
// calcolo folder
logDir = Path.Combine(TargetLogDir, iobData.CodIOB);
// recupero file odierno
DirectoryInfo dI = new DirectoryInfo(logDir);
var files = dI.GetFiles().Where(i => i.CreationTime >= minDate);
// copio in area temp...
foreach (var file in files)
{
Directory.CreateDirectory(Path.Combine(tempDir, iobData.CodIOB));
file.CopyTo(Path.Combine(tempDir, iobData.CodIOB, file.Name));
}
}
// creo unico ZIP
if (File.Exists(zipPath))
{
File.Delete(zipPath);
}
ZipFile.CreateFromDirectory(tempDir, zipPath);
btnSendLog.Text = "zip end";
btnSendLog.Refresh();
// ciclo di creazione ticket e upload file
try
{
// client chiamate rest
var client = new RestClient(ApiUrl);
client.UseNewtonsoftJson();
SupportRequest newSuppReq = new SupportRequest();
string licensePath = Path.Combine(Application.StartupPath, "CONF", "license.json");
string rawData = "";
if (File.Exists(licensePath))
{
rawData = File.ReadAllText(licensePath);
}
if (!string.IsNullOrEmpty(rawData))
{
// fare: composizione richiesta da parametri chiave
newSuppReq = JsonConvert.DeserializeObject<SupportRequest>(rawData);
}
else
{
string hostName = utils.machineName;
string listIP = string.Join(", ", utils.machineIp);
// genero il ticket
newSuppReq = new SupportRequest()
{
CodApp = "MAPO-IOB-WIN-NEXT",
CodImp = "",
CodInst = "SteamWare",
ContactEmail = "info@steamware.net",
ContactName = "Default Config",
ContactPhone = "035-460560",
MasterKey = "a3BRQz/1B34uvvcDoE/D38ssH/c/KSsjpn39wZsxOVsck9rGnBkF3xfUnj3edYIl",
ReqBody = $"File Upload - MISSING license file | machine: {utils.machineName} | IP: {listIP}",
Tipo = TipologiaTicket.FileUpload,
idxSubLic = 0
};
}
btnSendLog.Text = "LogSend start";
btnSendLog.BackColor = Color.DarkOrange;
btnSendLog.Refresh();
var ticketReq = new RestRequest("/api/ticket/sendReq", DataFormat.Json).AddJsonBody(newSuppReq);
var ticketResp = await client.PostAsync<TicketDTO>(ticketReq);
// preparo richiesta x upload file
var fileUploadReq = new RestRequest("/api/filesave/single");
fileUploadReq.AddParameter("ticketId", ticketResp.idxTicket);
fileUploadReq.AddFile("file", zipPath);
// ... infine INVIA file zip che li contiene...
//var fileUploadResp = client.Post(fileUploadReq);
var fileUploadResp = await client.PostAsync<UploadResult>(fileUploadReq);
btnSendLog.Text = "LogSend end";
btnSendLog.BackColor = Color.DarkOliveGreen;
btnSendLog.Refresh();
// elimino folder temporanea
if (Directory.Exists(tempDir))
{
Directory.Delete(tempDir, true);
}
// elimino il file temporaneo...
if (File.Exists(zipPath))
{
File.Delete(zipPath);
}
}
catch (Exception exc)
{
Logging.LogError($"Eccezione in fase gestione REST services{Environment.NewLine}{exc}");
}
}
btnSendLog.BackColor = stdColor;
btnSendLog.Text = stdText;
btnSendLog.Enabled = true;
}
}
}
+29 -7
View File
@@ -174,8 +174,9 @@ namespace IOB_UT_NEXT
public enum MachineSetupMode
{
ND = 0,
// Modalità Mecolpress (3 parametri IN, se variati --> porto a 1 la variabile di controllo)
/// <summary>
/// Modalità Mecolpress (3 parametri IN, se variati --> porto a 1 la variabile di controllo)
/// </summary>
MECOLPRESS = 1
}
@@ -342,11 +343,6 @@ namespace IOB_UT_NEXT
/// </summary>
OpcUaCMS,
/// <summary>
/// Adapter OPC-UA SCM
/// </summary>
OpcUaSCM,
/// <summary>
/// Adapter OPC-UA per Ewon
/// </summary>
@@ -367,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>
@@ -377,6 +383,21 @@ namespace IOB_UT_NEXT
/// </summary>
OpcUaOmronIcoel,
/// <summary>
/// Adapter OPC-UA SCM
/// </summary>
OpcUaSCM,
/// <summary>
/// Adapter OPC-UA Siemens generico
/// </summary>
OpcUaSiemens,
/// <summary>
/// Adapter OPC-UA Siemens OMP
/// </summary>
OpcUaSiemensOMP,
/// <summary>
/// Adapter OSAI CNDEX (Cndex)
/// </summary>
@@ -503,4 +524,5 @@ namespace IOB_UT_NEXT
/// </summary>
ULog
}
}
+22 -2
View File
@@ -55,12 +55,31 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote_DEBUG|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Remote_DEBUG\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote_DEBUG|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Remote_DEBUG\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<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.2205.2808, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MapoSDK.6.14.2205.2808\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>
@@ -125,6 +144,7 @@
<Compile Include="Eurom63.cs" />
<Compile Include="IobWinStatus.cs" />
<Compile Include="TCMan.cs" />
<Compile Include="TimeUtils.cs" />
<Compile Include="ToMapo.cs" />
<Compile Include="baseUtils.cs" />
<Compile Include="BinaryFormatter.cs" />
-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>
+16 -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>
@@ -121,16 +126,22 @@ namespace IOB_UT_NEXT
if (online != item.online)
return false;
// controllo se sia ALMENO 1 sec...
if (lastDataIn != item.lastDataIn)
// controllo se sia ALMENO 10 sec...
if (lastUpdate != item.lastUpdate)
{
if (lastDataIn.Subtract(item.lastDataIn).TotalSeconds > 1)
if (lastUpdate.Subtract(item.lastUpdate).TotalSeconds > minDeltaSec)
return false;
}
// controllo se sia ALMENO 1 sec...
// controllo se sia ALMENO 3 sec...
if (lastDataIn != item.lastDataIn)
{
if (lastDataIn.Subtract(item.lastDataIn).TotalSeconds > minDeltaSec)
return false;
}
// controllo se sia ALMENO 5 sec...
if (lastDataOut != item.lastDataOut)
{
if (lastDataOut.Subtract(item.lastDataOut).TotalSeconds > 1)
if (lastDataOut.Subtract(item.lastDataOut).TotalSeconds > minDeltaSec)
return false;
}
if (semIn != item.semIn)
+52 -9
View File
@@ -59,6 +59,52 @@ namespace IOB_UT_NEXT
#endregion Public Methods
}
#if false
/// <summary>
/// Classe di base per trasferimento informazioni di tipo RawTransfer
/// </summary>
public class BaseRawTransf
{
/// <summary>
/// Data-Ora riferimento (x ordinamento fifo)
/// </summary>
public DateTime dataRif { get; set; } = DateTime.Now;
/// <summary>
/// Messaggio in modalità raw/stringa
/// </summary>
public object mesContent { get; set; } = new object();
/// <summary>
/// Tipo di messaggio trasmesso
/// </summary>
public rawTransfType mesType { get; set; } = rawTransfType.ND;
/// <summary>
/// Costruttore senza parametri
/// </summary>
public BaseRawTransf()
{
this.dataRif = DateTime.Now;
this.mesContent = new object();
this.mesType = rawTransfType.ND;
}
/// <summary>
/// Costruttore oggetto
/// </summary>
/// <param name="dataRif"></param>
/// <param name="mesContent"></param>
/// <param name="mesType"></param>
public BaseRawTransf(DateTime dataRif, object mesContent, rawTransfType mesType)
{
this.dataRif = dataRif;
this.mesContent = mesContent;
this.mesType = mesType;
}
}
#endif
/// <summary>
/// Gestione dati di timing
/// </summary>
@@ -211,8 +257,6 @@ namespace IOB_UT_NEXT
/// </summary>
public class IobWinStatus
{
#region Public Properties
/// <summary>
/// ID univoco
/// </summary>
@@ -278,10 +322,6 @@ namespace IOB_UT_NEXT
/// </summary>
public int queueUlLen { get; set; } = 0;
#endregion Public Properties
#region Public Methods
/// <summary>
/// Override metodo di equality
/// </summary>
@@ -320,9 +360,7 @@ namespace IOB_UT_NEXT
{
return base.GetHashCode();
}
#endregion Public Methods
}
}
#endif
/// <summary>
@@ -770,6 +808,11 @@ namespace IOB_UT_NEXT
/// </summary>
public int Period { get; set; } = 60;
/// <summary>
/// UM parametro, impiegato anche x conversione (es epoch --&gt; datetime)
/// </summary>
public string UM { get; set; } = "";
#endregion Public Properties
}
}
+14 -10
View File
@@ -23,9 +23,13 @@ namespace IOB_UT_NEXT
/// <summary>
/// init classe gestione dati IOB su Redis
/// </summary>
/// <param name="codServer"></param>
/// <param name="codIob"></param>
public RedisIobCache(string codServer, string codIob, string tipoIob)
/// <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>
public RedisIobCache(string codServer, string codIob, string tipoIob, int minDeltaS)
{
// init dati di base...
currCodIob = codIob;
@@ -42,7 +46,8 @@ namespace IOB_UT_NEXT
{
CodIob = currCodIob,
IobType = currIobType,
online = false
online = false,
minDeltaSec = minDeltaS
};
// salvo in area REDIS
servStatus = newSrvStatus;
@@ -169,7 +174,6 @@ namespace IOB_UT_NEXT
{
string rawData = JsonConvert.SerializeObject(value);
saveAndSendMessage(redIobKey, redIobChannel, rawData);
//setRSV(redIobKey, rawData);
}
}
@@ -1103,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>
+18
View File
@@ -0,0 +1,18 @@
using System;
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
date = date.AddSeconds(epoch);
return date;
}
#endregion Public Methods
}
}
+48 -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
}
@@ -424,6 +450,24 @@ namespace IOB_UT_NEXT
{
#region Public Properties
/// <summary>
/// Elenco Variabili (e valori da impostare) x indicare di resettare contatore lotto e
/// quindi riavviare produzione (es: impostando valore a 1...)
/// </summary>
public Dictionary<string, string> actResetCounter { get; set; } = new Dictionary<string, string>();
/// <summary>
/// Elenco Variabili (e valori da impostare) x indicare di effettuare impostazione nuovo
/// programma/ricetta (es: impostando valore a 1...)
/// </summary>
public Dictionary<string, string> actSetRecipe { get; set; } = new Dictionary<string, string>();
/// <summary>
/// Elenco Variabili (e valori da impostare) x indicare di fermare la produzione (es:
/// impostando valore a 1...)
/// </summary>
public Dictionary<string, string> actStopProd { get; set; } = new Dictionary<string, string>();
/// <summary>
/// Identificativo nodo iniziale
/// </summary>
+4 -2
View File
@@ -41,12 +41,14 @@ 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();
#endregion Public Fields
#endif
#region Public Properties
+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.2205.2808" 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" />
+14 -14
View File
@@ -18,10 +18,10 @@ Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x86 = Debug|x86
FANUC|Any CPU = FANUC|Any CPU
FANUC|x86 = FANUC|x86
Release|Any CPU = Release|Any CPU
Release|x86 = Release|x86
Remote_DEBUG|Any CPU = Remote_DEBUG|Any CPU
Remote_DEBUG|x86 = Remote_DEBUG|x86
SIEMENS|Any CPU = SIEMENS|Any CPU
SIEMENS|x86 = SIEMENS|x86
EndGlobalSection
@@ -30,14 +30,14 @@ Global
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Debug|Any CPU.Build.0 = Debug|Any CPU
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Debug|x86.ActiveCfg = Debug|Any CPU
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Debug|x86.Build.0 = Debug|Any CPU
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.FANUC|Any CPU.ActiveCfg = Release|Any CPU
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.FANUC|Any CPU.Build.0 = Release|Any CPU
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.FANUC|x86.ActiveCfg = Debug|Any CPU
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.FANUC|x86.Build.0 = Debug|Any CPU
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Release|Any CPU.ActiveCfg = Release|Any CPU
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Release|Any CPU.Build.0 = Release|Any CPU
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Release|x86.ActiveCfg = Release|x86
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Release|x86.Build.0 = Release|x86
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Remote_DEBUG|Any CPU.ActiveCfg = Debug|Any CPU
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Remote_DEBUG|Any CPU.Build.0 = Debug|Any CPU
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Remote_DEBUG|x86.ActiveCfg = Remote_DEBUG|x86
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Remote_DEBUG|x86.Build.0 = Remote_DEBUG|x86
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.SIEMENS|Any CPU.ActiveCfg = Release|Any CPU
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.SIEMENS|Any CPU.Build.0 = Release|Any CPU
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.SIEMENS|x86.ActiveCfg = Debug|Any CPU
@@ -46,14 +46,14 @@ Global
{90512E12-29FC-460D-94CC-648C2A072DBD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{90512E12-29FC-460D-94CC-648C2A072DBD}.Debug|x86.ActiveCfg = Debug|x86
{90512E12-29FC-460D-94CC-648C2A072DBD}.Debug|x86.Build.0 = Debug|x86
{90512E12-29FC-460D-94CC-648C2A072DBD}.FANUC|Any CPU.ActiveCfg = Release|Any CPU
{90512E12-29FC-460D-94CC-648C2A072DBD}.FANUC|Any CPU.Build.0 = Release|Any CPU
{90512E12-29FC-460D-94CC-648C2A072DBD}.FANUC|x86.ActiveCfg = Debug|x86
{90512E12-29FC-460D-94CC-648C2A072DBD}.FANUC|x86.Build.0 = Debug|x86
{90512E12-29FC-460D-94CC-648C2A072DBD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{90512E12-29FC-460D-94CC-648C2A072DBD}.Release|Any CPU.Build.0 = Release|Any CPU
{90512E12-29FC-460D-94CC-648C2A072DBD}.Release|x86.ActiveCfg = Release|x86
{90512E12-29FC-460D-94CC-648C2A072DBD}.Release|x86.Build.0 = Release|x86
{90512E12-29FC-460D-94CC-648C2A072DBD}.Remote_DEBUG|Any CPU.ActiveCfg = Debug|Any CPU
{90512E12-29FC-460D-94CC-648C2A072DBD}.Remote_DEBUG|Any CPU.Build.0 = Debug|Any CPU
{90512E12-29FC-460D-94CC-648C2A072DBD}.Remote_DEBUG|x86.ActiveCfg = Remote_DEBUG|x86
{90512E12-29FC-460D-94CC-648C2A072DBD}.Remote_DEBUG|x86.Build.0 = Remote_DEBUG|x86
{90512E12-29FC-460D-94CC-648C2A072DBD}.SIEMENS|Any CPU.ActiveCfg = Release|Any CPU
{90512E12-29FC-460D-94CC-648C2A072DBD}.SIEMENS|Any CPU.Build.0 = Release|Any CPU
{90512E12-29FC-460D-94CC-648C2A072DBD}.SIEMENS|x86.ActiveCfg = Debug|x86
@@ -62,14 +62,14 @@ Global
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Debug|x86.ActiveCfg = Debug|x86
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Debug|x86.Build.0 = Debug|x86
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.FANUC|Any CPU.ActiveCfg = Release|Any CPU
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.FANUC|Any CPU.Build.0 = Release|Any CPU
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.FANUC|x86.ActiveCfg = Debug|x86
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.FANUC|x86.Build.0 = Debug|x86
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Release|Any CPU.Build.0 = Release|Any CPU
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Release|x86.ActiveCfg = Release|x86
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Release|x86.Build.0 = Release|x86
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Remote_DEBUG|Any CPU.ActiveCfg = Remote_DEBUG|Any CPU
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Remote_DEBUG|Any CPU.Build.0 = Remote_DEBUG|Any CPU
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Remote_DEBUG|x86.ActiveCfg = Remote_DEBUG|x86
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Remote_DEBUG|x86.Build.0 = Remote_DEBUG|x86
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.SIEMENS|Any CPU.ActiveCfg = Release|Any CPU
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.SIEMENS|Any CPU.Build.0 = Release|Any CPU
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.SIEMENS|x86.ActiveCfg = Debug|x86
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)
{
+1 -1
View File
@@ -4,7 +4,7 @@
CNCTYPE=SIEMENS_COSMAP
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=COSMAP
MODEL=02
+1 -1
View File
@@ -4,7 +4,7 @@
CNCTYPE=SIEMENS_ROBOTSERVICE
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=RobotService
MODEL=SMER12
+1 -1
View File
@@ -4,7 +4,7 @@
CNCTYPE=SIEMENS_ROBOTSERVICE
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=RobotService
MODEL=SCAT06
+1 -1
View File
@@ -4,7 +4,7 @@
CNCTYPE=SIEMENS_ROBOTSERVICE
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=RobotService
MODEL=SCAT05
+1 -1
View File
@@ -4,7 +4,7 @@
CNCTYPE=SIEMENS_APROCHIM
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=Aprochim
MODEL=Micro4000
+1 -1
View File
@@ -4,7 +4,7 @@
CNCTYPE=WPS
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=Atlas Copco
MODEL=GA18VP_13
+1 -1
View File
@@ -4,7 +4,7 @@
CNCTYPE=WPS
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=Atlas Copco
MODEL=GA18VP_12
+1 -1
View File
@@ -26,7 +26,7 @@ CMDREBO=/sendReboot.aspx?idxMacchina=
; Red: Y31.4 | Yellow: Y31.5 | Green Y31.6 | riscaldamento Y7.4 ???
;BIT0=CONN
BIT1=Y31.6
BIT2=STD.MACRO.10100
BIT2=PZCOUNT.MACRO.10100
BIT3=Y31.4
BIT4=Y31.5
BIT5=Y7.4
@@ -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"
]
}
]
+3 -3
View File
@@ -4,15 +4,15 @@
CNCTYPE=FILE_EUROM63
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=PlasticMetal
MODEL=MPW280SP
[CNC]
IP=10.74.82.253
IP=10.74.82.253
;IP=192.168.1.151
[SERVER]
[SERVER]
MPIP=http://10.74.82.218
;MPIP=http://192.168.1.150
MPURL=/MP/IO
+17 -13
View File
@@ -1,35 +1,36 @@
;Configurazione IOB-WIN
[IOB]
[IOB]
;Impianto Helpi x impacchettatrice - Finassi
CNCTYPE=MODBUS_TCP_HELPI
PING_MS_TIMEOUT=1000
MinDeltaSec=5
[MACHINE]
[MACHINE]
VENDOR=HELPI
MODEL=HELPI
[CNC]
IP=10.74.82.65
IP=10.150.0.20
PORT=502
[SERVER]
MPIP=https://iis01.egalware.com
;MPIP=https://gwms.egalware.com
MPIP=http://10.150.0.1
MPURL=/MP/IO
CMDBASE=/IOB/input/
CMDFLOG=/IOB/flog/
CMDALIVE=/IOB
CMDENABLED=/IOB/enabled/
CMDADV1=?valore=
CMDREBO=/IOB/sendReboot?idxMacchina=
;CMDREBO=/sendReboot.aspx?idxMacchina=
CMDREBO=/sendReboot.aspx?idxMacchina=
[MEMORY]
ADDR_READ=41060
ADDR_READ=41050
ADDR_WRITE=41060
SIZE_READ=0
SIZE_WRITE=0
HR_BASE_ADDR=40000
SIZE_READ=60
SIZE_WRITE=50
HR_BASE_ADDR=0
;HR_BASE_ADDR=40000
DELTA_BASE=0
[BLINK]
@@ -47,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
@@ -71,5 +72,8 @@ MEM_BLOCK=FINASSI_HELPI_01_MBlock.json
; conf aree allarme
ALARM_CONF=FINASSI_HELPI_01_alarm.json
; rimozione check limiti min/max dynData
disDynDataRangeCheck=true
[BRANCH]
NAME=master
+18 -18
View File
@@ -44,7 +44,7 @@
"name": "NumPacchi",
"description": "Numero Pacchi Richiesti",
"memAddr": "41098",
"tipoMem": "INT",
"tipoMem": "IntLH",
"index": 1098,
"size": 2,
"unit": "#"
@@ -61,7 +61,7 @@
"minVal": 0,
"maxVal": 32767,
"unit": "#",
"func": "MEDIAN",
"func": "POINT",
"period": 90,
"factor": 1
},
@@ -75,7 +75,7 @@
"minVal": 0,
"maxVal": 1,
"unit": "#",
"func": "MEDIAN",
"func": "POINT",
"period": 90,
"factor": 1
},
@@ -87,7 +87,7 @@
"index": 1062,
"size": 16,
"unit": "#",
"func": "LAST",
"func": "POINT",
"period": 90
},
"LOTTO": {
@@ -98,18 +98,18 @@
"index": 1078,
"size": 16,
"unit": "#",
"func": "LAST",
"func": "POINT",
"period": 90
},
"NumPacchi": {
"name": "NumPacchi",
"description": "Numero Pacchi Richiesti",
"memAddr": "41098",
"tipoMem": "INT",
"tipoMem": "IntLH",
"index": 1098,
"size": 2,
"unit": "#",
"func": "MEDIAN",
"func": "POINT",
"period": 90,
"factor": 1
},
@@ -117,11 +117,11 @@
"name": "NumPacchiFatti",
"description": "Numero Pacchi Fatti",
"memAddr": "41100",
"tipoMem": "INT",
"tipoMem": "IntLH",
"index": 1100,
"size": 2,
"unit": "#",
"func": "MEDIAN",
"func": "POINT",
"period": 90,
"factor": 1
},
@@ -129,11 +129,11 @@
"name": "EpochStart",
"description": "DateTime inizio lavorazione formato EPOCH",
"memAddr": "41102",
"tipoMem": "INT",
"tipoMem": "IntLH",
"index": 1102,
"size": 2,
"unit": "#",
"func": "LAST",
"unit": "EPOCH",
"func": "POINT",
"period": 90,
"factor": 1
},
@@ -141,23 +141,23 @@
"name": "EpochStop",
"description": "DateTime fine lavorazione formato EPOCH",
"memAddr": "41104",
"tipoMem": "INT",
"tipoMem": "IntLH",
"index": 1104,
"size": 2,
"unit": "#",
"func": "LAST",
"unit": "EPOCH",
"func": "POINT",
"period": 90,
"factor": 1
},
"PPM": {
"name": "PPM",
"description": "Velocit espressa come Pacchi Per Minuto",
"description": "Velocita espressa come Pacchi Per Minuto",
"memAddr": "41106",
"tipoMem": "Real",
"tipoMem": "RealLH",
"index": 1106,
"size": 2,
"unit": "#",
"func": "LAST",
"func": "POINT",
"period": 90,
"factor": 1
}
@@ -4,7 +4,7 @@
"tipoMem": "DInt",
"memAddr": "41094",
"index": 1094,
"size": 2,
"size": 4,
"messages": [
"AUSILIARI NON INSERITI",
"TERMICA SBOBINATORI",
@@ -37,8 +37,7 @@
"BYPASS SPORTELLI INSERITO",
"BARRA SALDANTE NON IN POSIZIONE, EFFETTUARE SALDATURA MANUALE",
"GESTIONALE: MACCHINA IN CICLO",
"GESTIONALE: RICETTA NON TROVATA",
"PROBLEMA FC BYPASS EMERGENZA BARRA"
"GESTIONALE: RICETTA NON TROVATA"
]
},
{
@@ -46,8 +45,9 @@
"tipoMem": "DInt",
"memAddr": "41096",
"index": 1096,
"size": 2,
"size": 4,
"messages": [
"PROBLEMA FC BYPASS EMERGENZA BARRA",
"PROBLEMA FC EMERGENZA BARRA",
"##",
"##",
@@ -78,7 +78,6 @@
"##",
"##",
"##",
"##",
"##"
]
}
+67
View File
@@ -0,0 +1,67 @@
;Configurazione IOB-WIN
[IOB]
;Centro di lavoro OMP (https://omp.it/) con controllo siemens S7-1200 + OpcUa
CNCTYPE=OpcUaSiemensOMP
PING_MS_TIMEOUT=500
[MACHINE]
VENDOR=OMP
MODEL=Infilatrice
[CNC]
IP=10.150.0.41
PORT=4840
GETPRGNAME=true
[SERVER]
MPIP=http://10.150.0.1
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 = 1
;bit0 = 0
;bit1 = 0
;bit2 = 1
;bit3 = 1
;bit4 = 1
;bit5 = 0
;bit6 = 0
;bit7 = 0
;BLINK_FILT=28
BLINK_FILT=131
[OPTPAR]
AUTO_CHANGE_ODL=false
CHANGE_ODL_MODE=TIME
CHANGE_ODL_HOURS=24
CHANGE_ODL_IDLE_MIN=5
PZCOUNT_MODE=OPC
DISABLE_PZCOUNT=FALSE
ENABLE_SEND_PZC_BLOCK=TRUE
MIN_SEND_PZC_BLOCK=0
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
[BRANCH]
NAME=master
+132
View File
@@ -0,0 +1,132 @@
{
"BrowseFullVal": "ns=3;s=ServerInterfaces",
"BrowseNSIndex": 4,
"BrowseValue": 1,
"keyPartCount": "Conteggio",
"keyPartReq": "Set Quantità Lotto",
"keyPartId": "Generale: Nome Ricetta",
"keyProgName": "Generale: Nome Ricetta",
"keyRunMode": "",
"pingAsPowerOn": true,
"condWork": [
{
"keyName": "Selettore in Automatico",
"targetValue": "True"
},
{
"keyName": "Memoria Ciclo Automatico",
"targetValue": "True"
}
],
"condPowerOn": {
"checkMode": "AND",
"checkList": []
},
"condReady": {
"checkMode": "AND",
"checkList": []
},
"condManual": {
"checkMode": "AND",
"checkList": [
{
"keyName": "Selettore in Manuale",
"targetValue": "True"
}
]
},
"condEStop": {
"checkMode": "AND",
"checkList": []
},
"condError": {
"checkMode": "AND",
"checkList": [
{
"keyName": "Memoria Allarme Attivo",
"targetValue": "True"
}
]
},
"condCountEnabled": {
"checkMode": "AND",
"checkList": []
},
"condWarmUpCoolDown": {
"checkMode": "OR",
"checkList": [],
"negateValue": true
},
"condWarning": {
"checkMode": "AND",
"checkList": []
},
"condSetup": {
"checkMode": "AND",
"checkList": [
{
"keyName": "Fine Lotto (1=Stop Ciclo)",
"targetValue": "1"
}
]
},
"fluxLogVeto": [
""
],
"itemTranslation": {
"fdovrd": "PATH FEED OVERRIDE",
"rovrd": "PATH RAPID OVERRIDE"
},
"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": [
"ns=4;i=1",
"ns=4;i=2",
"ns=4;i=3",
"ns=4;i=4",
"ns=4;i=5",
"ns=4;i=6",
"ns=4;i=7",
"ns=4;i=8",
"ns=4;i=9",
"ns=4;i=10",
"ns=4;i=11",
"ns=4;i=12",
"ns=4;i=13",
"ns=4;i=14"
],
"WatchDog": {
"IsEnabled": false,
"MemConfRead": "ns=4;s=tomes_1_Watchdog",
"MemConfWrite": "ns=4;s=tomach_1_watchdog",
"MaxVal": 9999
},
"actStopProd": {
"ns=4;i=14": "1"
},
"actSetRecipe": {
"ns=4;i=10": "1"
},
"actResetCounter": {
"ns=4;i=13": "1"
}
}
+1 -1
View File
@@ -5,7 +5,7 @@ CNCTYPE=OpcUaCMS
;CNCTYPE=OpcUa
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=CMS
MODEL=Eidos
+2 -1
View File
@@ -3,8 +3,9 @@
;Impianto Cedax di Turi (test) - Giacovelli
CNCTYPE=MODBUS_TCP_CEDAX
PING_MS_TIMEOUT=1000
MinDeltaSec=5
[MACHINE]
[MACHINE]
VENDOR=CEDAX
MODEL=CEDAX Hydrocooler
+2 -1
View File
@@ -3,8 +3,9 @@
;Impianto Cedax di Turi (test) - Giacovelli
CNCTYPE=MODBUS_TCP_CEDAX
PING_MS_TIMEOUT=1000
MinDeltaSec=5
[MACHINE]
[MACHINE]
VENDOR=CEDAX
MODEL=CEDAX Scarico
+2 -1
View File
@@ -3,8 +3,9 @@
;Impianto Cedax di Turi (test) - Giacovelli
CNCTYPE=MODBUS_TCP_CEDAX
PING_MS_TIMEOUT=1000
MinDeltaSec=5
[MACHINE]
[MACHINE]
VENDOR=CEDAX
MODEL=CEDAX Lavorazione
+2 -1
View File
@@ -3,8 +3,9 @@
;Impianto Cedax di Turi (test) - Giacovelli
CNCTYPE=MODBUS_TCP_CENTERFRIGO
PING_MS_TIMEOUT=1000
MinDeltaSec=5
[MACHINE]
[MACHINE]
VENDOR=Centerfrigo
MODEL=Impianto Turi
+52 -20
View File
@@ -1,31 +1,63 @@
{
"mMapWrite": {
"TestWrite": {
"name": "TestWrite",
"description": "Test Scrittura",
"memAddr": "41621",
"tipoMem": "Real",
"index": 1621,
"SetPoint_Tunnel_Req": {
"name": "SetPoint_Tunnel_Req",
"description": "Setpoint Tunnel",
"memAddr": "44010",
"tipoMem": "RealLH",
"index": 4010,
"size": 2,
"func": "MEDIAN",
"period": 60,
"factor": 1,
"minVal": -100,
"maxVal": 100,
"minVal": -5,
"maxVal": 15,
"unit": "°C"
},
"SetPoint_Tunnel": {
"name": "SetPoint_Tunnel",
"description": "Setpoint Tunnel",
"memAddr": "41560",
"tipoMem": "Real",
"index": 1560,
"SetPoint_Cella_01_Req": {
"name": "SetPoint_Cella_01_Req",
"description": "Setpoint Cella 01",
"memAddr": "44012",
"tipoMem": "RealLH",
"index": 4012,
"size": 2,
"func": "MEDIAN",
"period": 60,
"factor": 1,
"minVal": -100,
"maxVal": 100,
"minVal": -5,
"maxVal": 15,
"unit": "°C"
},
"SetPoint_Cella_02_Req": {
"name": "SetPoint_Cella_02_Req",
"description": "Setpoint Cella 02",
"memAddr": "44014",
"tipoMem": "RealLH",
"index": 4014,
"size": 2,
"factor": 1,
"minVal": -5,
"maxVal": 15,
"unit": "°C"
},
"SetPoint_Cella_03_Req": {
"name": "SetPoint_Cella_03_Req",
"description": "Setpoint Cella 03",
"memAddr": "44016",
"tipoMem": "RealLH",
"index": 4016,
"size": 2,
"factor": 1,
"minVal": -5,
"maxVal": 15,
"unit": "°C"
},
"SetPoint_Cella_04_Req": {
"name": "SetPoint_Cella_04_Req",
"description": "Setpoint Cella 04",
"memAddr": "44018",
"tipoMem": "RealLH",
"index": 4018,
"size": 2,
"factor": 1,
"minVal": -5,
"maxVal": 15,
"unit": "°C"
}
},
@@ -3,6 +3,7 @@
;Centro di lavoro OpcUa
CNCTYPE=OpcUaOmronIcoel
PING_MS_TIMEOUT=500
MinDeltaSec=5
[MACHINE]
VENDOR=ICOEL
@@ -3,6 +3,7 @@
;WebService SOAP x sizer
CNCTYPE=IcoelSoap
PING_MS_TIMEOUT=500
MinDeltaSec=5
;IOB_NAME=GIACO_ICOEL
[MACHINE]
@@ -3,6 +3,7 @@
;Accesso gestione sync DB x sync ICOEL --> MoonPro_ISF --> MoonPro_IS
CNCTYPE=IcoelDb
PING_MS_TIMEOUT=500
MinDeltaSec=5
;IOB_NAME=GIACO_ICOEL
[MACHINE]
+2 -1
View File
@@ -3,8 +3,9 @@
;Macchina pulitrice RobotService x Donati
CNCTYPE=SIEMENS_NWSE
PING_MS_TIMEOUT=500
MinDeltaSec=5
[MACHINE]
[MACHINE]
VENDOR=NWS
MODEL=Impianto Turi
+1 -1
View File
@@ -4,7 +4,7 @@
CNCTYPE=MTConnect
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=Mitsubishi
MODEL=PowerCenterPro1000
+1 -1
View File
@@ -4,7 +4,7 @@
CNCTYPE=MTConnect
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=Okuma
MODEL=Lathe 2SP-35HG
+1 -1
View File
@@ -4,7 +4,7 @@
CNCTYPE=MTConnect
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=HAAS
MODEL=UMC-500
+1 -1
View File
@@ -4,7 +4,7 @@
CNCTYPE=MTConnect
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=HAAS
MODEL=UMC-750
+1 -1
View File
@@ -4,7 +4,7 @@
CNCTYPE=MTConnect
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=CMS
MODEL=WaterJet
+1 -1
View File
@@ -4,7 +4,7 @@
CNCTYPE=SIEMENS_AT2001
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=SAET
MODEL=Preriscaldo_105B08
+1 -1
View File
@@ -4,7 +4,7 @@
CNCTYPE=OMRON
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=EDF
MODEL=MiscelazioneOssidiFerro
+75
View File
@@ -0,0 +1,75 @@
;Configurazione IOB-WIN
[IOB]
CNCTYPE=FANUC
[MACHINE]
VENDOR=COLCOM
MODEL=DMG-MORI
[CNC]
; TEST FANUC!
IP=192.168.100.78
PORT=8193
GETPRGNAME=true
[SERVER]
MPIP=192.168.111.104
MPURL=/MP/IO
CMDBASE=/IOB/input/
CMDFLOG=/IOB/flog/
CMDALIVE=/IOB
CMDENABLED=/IOB/enabled/
CMDADV1=?valore=
CMDREBO=/sendReboot.aspx?idxMacchina=
[MEMORY]
; Red: Y12.4 | Yellow: Y51.1 (porta chiusa, da NEGARE) | Green Y12.6 | Alarm Y 51.4 | Blu Y12.7
;BIT0=CONN
BIT1=Y12.6
BIT2=PZCOUNT.PAR.6711
BIT3=Y12.4
BIT4=Y12.7
;BIT5=Y11.2
BIT5=X18.3
BIT6=X11.3
AREAD_START=0
AREAD_SIZE=9999
AREAG_SIZE=48
AREAR_START=0
AREAR_SIZE=64
AREAX_START=0
AREAX_SIZE=64
AREAY_START=0
AREAY_SIZE=64
PAR_START=6711
PAR_SIZE=3
[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=0
;BLINK_FILT=28
[OPTPAR]
;PZCOUNT_MODE=STD|BIT
PZCOUNT_MODE=STD.PAR.6711
PZGTOT_MODE=STD.PAR.6712
;PZREQ_MODE=STD.PAR.6713
ENABLE_PZ_RESET=TRUE
ENABLE_PZ_RESET_stopSetup=TRUE
;gestione invio pezzi in blocco
ENABLE_SEND_PZC_BLOCK=TRUE
MIN_SEND_PZC_BLOCK=0
MAX_SEND_PZC_BLOCK=100
[BRANCH]
NAME=master
+4 -1
View File
@@ -38,6 +38,9 @@ CLI_INST=SteamWareSim
;STARTLIST=GIACO_ICOEL_002
;STARTLIST=GIACO_CENTERFRIGO
;STARTLIST=GIACO_NWSE
STARTLIST=SIMUL_01
;STARTLIST=SIM_DP_01
STARTLIST=FINASSI_HELPI_01
;STARTLIST=FINASSI_OMP_01
;STARTLIST=BAGLIETTO_CIMOLAI_01
MAXCNC=10
+1 -1
View File
@@ -5,7 +5,7 @@ CNCTYPE=OpcUaEwon
;CNCTYPE=OpcUa
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=OpcUa
MODEL=Std
+1 -1
View File
@@ -4,7 +4,7 @@
CNCTYPE=SIEMENS_COMECA
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=COMECA
MODEL=01
+1 -1
View File
@@ -4,7 +4,7 @@
CNCTYPE=MODBUS_TCP_HAM
PING_MS_TIMEOUT=1000
[MACHINE]
[MACHINE]
VENDOR=HAM
MODEL=HAM
+1 -1
View File
@@ -4,7 +4,7 @@
CNCTYPE=MODBUS_TCP_HAM
PING_MS_TIMEOUT=1000
[MACHINE]
[MACHINE]
VENDOR=HAM
MODEL=HAM
+1 -1
View File
@@ -4,7 +4,7 @@
CNCTYPE=SIEMENS_COMECA
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=COMECA
MODEL=01
+1 -1
View File
@@ -4,7 +4,7 @@
CNCTYPE=MODBUS_TCP_HAM
PING_MS_TIMEOUT=1000
[MACHINE]
[MACHINE]
VENDOR=HAM
MODEL=HAM
+2 -1
View File
@@ -1,7 +1,8 @@
;Configurazione IOB-WIN
[IOB]
CNCTYPE=SIMULA
CNCTYPE=SIMULA
PING_MS_TIMEOUT=500
MinDeltaSec=5
[MACHINE]
VENDOR=STEAMWARE
+2 -1
View File
@@ -1,7 +1,8 @@
;Configurazione IOB-WIN
[IOB]
CNCTYPE=SIMULA
CNCTYPE=SIMULA
PING_MS_TIMEOUT=500
MinDeltaSec=5
[MACHINE]
VENDOR=STEAMWARE
+2 -1
View File
@@ -1,7 +1,8 @@
;Configurazione IOB-WIN
[IOB]
CNCTYPE=SIMULA
CNCTYPE=SIMULA
PING_MS_TIMEOUT=500
MinDeltaSec=5
[MACHINE]
VENDOR=STEAMWARE
+2 -1
View File
@@ -1,7 +1,8 @@
;Configurazione IOB-WIN
[IOB]
CNCTYPE=SIMULA
CNCTYPE=SIMULA
PING_MS_TIMEOUT=500
MinDeltaSec=5
[MACHINE]
VENDOR=STEAMWARE
+2 -1
View File
@@ -1,7 +1,8 @@
;Configurazione IOB-WIN
[IOB]
CNCTYPE=SIMULA
CNCTYPE=SIMULA
PING_MS_TIMEOUT=500
MinDeltaSec=5
[MACHINE]
VENDOR=STEAMWARE
+2 -1
View File
@@ -1,7 +1,8 @@
;Configurazione IOB-WIN
[IOB]
CNCTYPE=SIMULA
CNCTYPE=SIMULA
PING_MS_TIMEOUT=500
MinDeltaSec=5
[MACHINE]
VENDOR=STEAMWARE
+2 -1
View File
@@ -1,7 +1,8 @@
;Configurazione IOB-WIN
[IOB]
CNCTYPE=SIMULA
CNCTYPE=SIMULA
PING_MS_TIMEOUT=500
MinDeltaSec=5
[MACHINE]
VENDOR=STEAMWARE
+2 -1
View File
@@ -1,7 +1,8 @@
;Configurazione IOB-WIN
[IOB]
CNCTYPE=SIMULA
CNCTYPE=SIMULA
PING_MS_TIMEOUT=500
MinDeltaSec=5
[MACHINE]
VENDOR=STEAMWARE
+3 -2
View File
@@ -1,7 +1,8 @@
;Configurazione IOB-WIN
[IOB]
CNCTYPE=SIMULA
CNCTYPE=SIMULA
PING_MS_TIMEOUT=500
MinDeltaSec=5
[MACHINE]
VENDOR=STEAMWARE
@@ -50,7 +51,7 @@ SIM_PZCNT=10|3
SIM_ALARM=1000|20
SIM_MANU=50|6
; 1 = indica che la macchina è multi --> allo scadere del contapezzo gestisce ANCHE il giro tavola sui bit relativi
SIM_MULTI=1
IS_MULTI=1
; indica gestione e simulazione bit 5 --> slow/emergenza
SIM_SLOW=3500|20
; indica gestione e simulazione bit 6 --> warmup/cooldown
+4 -3
View File
@@ -1,7 +1,8 @@
;Configurazione IOB-WIN
[IOB]
CNCTYPE=SIMULA
CNCTYPE=SIMULA
PING_MS_TIMEOUT=500
MinDeltaSec=5
[MACHINE]
VENDOR=STEAMWARE
@@ -24,7 +25,7 @@ CMD_ODL_STARTED=/IOB/getCurrOdlStart/
CMD_FORCLE_SPLIT_ODL=/IOB/forceSplitOdlFull/
CMD_IDLE_TIME=/IOB/getIdlePeriod/
[MEMORY]
[MEMORY]
[BLINK]
MAX_COUNTER_BLINK = 15
@@ -50,7 +51,7 @@ SIM_PZCNT=10|2
SIM_ALARM=1000|20
SIM_MANU=50|6
; 1 = indica che la macchina è multi --> allo scadere del contapezzo gestisce ANCHE il giro tavola sui bit relativi
SIM_MULTI=1
IS_MULTI=1
; indica gestione e simulazione bit 5 --> slow/emergenza
SIM_SLOW=6500|20
; indica gestione e simulazione bit 6 --> warmup/cooldown
+1 -1
View File
@@ -4,7 +4,7 @@
CNCTYPE=MTConnect
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=CMS
MODEL=WaterJet
+1 -1
View File
@@ -4,7 +4,7 @@
CNCTYPE=OpcUaEwonMonti
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=Monti
MODEL=Std
+1 -1
View File
@@ -4,7 +4,7 @@
CNCTYPE=SIEMENS_SAET
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=SAET
MODEL=Preriscaldo_105B08
+1 -1
View File
@@ -4,7 +4,7 @@
CNCTYPE=SIEMENS_SAET
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=SAET
MODEL=FornoTemprainduzione_105B08
+1 -1
View File
@@ -4,7 +4,7 @@
CNCTYPE=SIEMENS_COMUR
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=COMUR
MODEL=DENTATRICE_PE125H
+1 -1
View File
@@ -4,7 +4,7 @@
CNCTYPE=SIEMENS_LASCO
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=LASCP
MODEL=PRESSA_3150
+1 -1
View File
@@ -4,7 +4,7 @@
CNCTYPE=SIEMENS_PRESSOIL_CEI
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=PRESSOIL_CEI
MODEL=PRESSA_IDRAULICA
+1 -1
View File
@@ -4,7 +4,7 @@
CNCTYPE=SIEMENS_SAET
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=SAET
MODEL=Preriscaldo_105B08
+1 -1
View File
@@ -4,7 +4,7 @@
CNCTYPE=SIEMENS_INGENIA
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=INGENIA
MODEL=RobotAutomPressaValvital
+1 -1
View File
@@ -4,7 +4,7 @@
CNCTYPE=SIEMENS_SIMEC
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=SIMEC
MODEL=180
+1 -1
View File
@@ -4,7 +4,7 @@
CNCTYPE=WPS
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=Atlas Copco
MODEL=GA18VP_13
+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
{
+47 -8
View File
@@ -74,6 +74,25 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote_DEBUG|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Remote_DEBUG\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote_DEBUG|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Remote_DEBUG\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="AutoUpdater.NET, Version=1.7.0.0, Culture=neutral, PublicKeyToken=501435c91b35f4bc, processorArchitecture=MSIL">
<HintPath>..\packages\Autoupdater.NET.Official.1.7.0\lib\net45\AutoUpdater.NET.dll</HintPath>
@@ -94,7 +113,7 @@
<HintPath>..\packages\EgwProxy.Icoel.3.6.2206.2811\lib\EgwProxy.Icoel.DataLayer.dll</HintPath>
</Reference>
<Reference Include="EgwProxy.MultiCncLib, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\EgwProxy.MultiCncLib.3.6.2207.1116\lib\EgwProxy.MultiCncLib.dll</HintPath>
<HintPath>..\packages\EgwProxy.MultiCncLib.3.6.2207.1211\lib\EgwProxy.MultiCncLib.dll</HintPath>
</Reference>
<Reference Include="EgwProxy.OsaiCncLib, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\EgwProxy.OsaiCncLib.3.6.2205.2015\lib\EgwProxy.OsaiCncLib.dll</HintPath>
@@ -112,8 +131,8 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>ExtLib\krcc.dll</HintPath>
</Reference>
<Reference Include="MapoSDK, Version=6.14.2206.2718, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MapoSDK.6.14.2206.2718\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>
@@ -210,6 +229,10 @@
<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" />
<Compile Include="IobOpcUaOmron.cs" />
<Compile Include="IobOpcUaEwonBLM.cs" />
@@ -285,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>
@@ -321,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>
@@ -360,16 +392,16 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\FINASSI_HELPI_01.ini">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\FINASSI_HELPI_01.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\FINASSI_HELPI_01_alarm.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\FINASSI_HELPI_01_MBlock.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\GIACO_ICOEL_002.ini">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@@ -395,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">
@@ -409,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>
@@ -602,6 +635,12 @@
<None Include="DATA\CONF\MECART_80.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\FINASSI_OMP_01.ini">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\FINASSI_OMP_01.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\STEL_200.ini">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
+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
{
+26 -17
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", "/IOB/enabled/", "/sendReboot.aspx?idxMacchina=", "/IOB/getCurrOdlStart/");
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)
@@ -146,7 +149,10 @@ namespace IOB_WIN_NEXT
/// <param name="CMDENABLED_">Comando x check abilitato</param>
/// <param name="CMDREBO_">Comando x reboot</param>
/// <param name="CMD_ODL_STARTED_">Comando x check data avvio ODL</param>
/// <param name="CLI_INST_">Installazione</param>
/// <param name="CMD_FORCLE_SPLIT_ODL_">Comando x forzare split ODL</param>
/// <param name="CMD_IDLE_TIME_">URL calcolo idle time</param>
/// <param name="CMDRAWTRANSFJSON_">Url invio raw transf</param>
public serverMapo(string MPIP_, string MPURL_ = "/MP/IO", string CMDBASE_ = "/IOB/input/", string CMDFLOG_ = "/IOB/flog/", string CMDULOG_ = "/IOB/ulog/", string CMDALIVE_ = "IOB", string CMDENABLED_ = "/IOB/enabled/", string CMDREBO_ = "/sendReboot.aspx?idxMacchina=", string CMD_ODL_STARTED_ = "/IOB/getCurrOdlStart/", string CLI_INST_ = "SteamWare", string CMD_FORCLE_SPLIT_ODL_ = "/IOB/forceSplitOdlFull/", string CMD_IDLE_TIME_ = "/IOB/getIdlePeriod/", string CMDRAWTRANSFJSON_ = "/IOB/rawTransfJson/")
{
if (!string.IsNullOrEmpty(MPIP_))
@@ -233,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
+249 -36
View File
@@ -125,7 +125,7 @@ namespace IOB_WIN_NEXT
public DateTime lastDisconnCheck;
/// <summary>
/// Data/ora ultima volta che IOB è stato dichairato online
/// Data/ora ultima volta che IOB è stato dichiarato online
/// </summary>
public DateTime lastIobOnline = DateTime.Now.AddHours(-1);
@@ -280,7 +280,7 @@ namespace IOB_WIN_NEXT
if (IOBConf != null)
{
// init oggetto redis...
redisMan = new RedisIobCache(IOBConf.serverData.MPIP, IOBConf.codIOB, IOBConf.tipoIob.ToString());
redisMan = new RedisIobCache(IOBConf.serverData.MPIP, IOBConf.codIOB, IOBConf.tipoIob.ToString(), IOBConf.minDeltaSec);
// initi oggetto TCMan
tcMan = new TCMan(IOBConf.TCLambda, IOBConf.TCMaxDelayFactor, IOBConf.TCMaxIncrPz);
@@ -1367,7 +1367,7 @@ namespace IOB_WIN_NEXT
* */
// serializzo il valore...
BaseRawTransf newVal = new BaseRawTransf(DateTime.Now, mesContent, mesType);
BaseRawTransf newVal = new BaseRawTransf(DateTime.Now, (Newtonsoft.Json.Linq.JObject)mesContent, mesType);
string encodedVal = JsonConvert.SerializeObject(newVal);
// --> accodo (valore già formattato)!
QueueRawTransf.Enqueue(encodedVal);
@@ -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
@@ -3155,7 +3200,7 @@ namespace IOB_WIN_NEXT
}
else
{
lgError($"Errore in invio richiesta registrazione allarme: URL: {lastUrl}{Environment.NewLine}Payload:{Environment.NewLine}{rawData}");
lgError($"Errore in invio richiesta registrazione allarme | resp: {resp} | URL: {lastUrl}{Environment.NewLine}Payload:{Environment.NewLine}{rawData}");
}
}
return fatto;
@@ -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
@@ -4902,6 +5114,7 @@ namespace IOB_WIN_NEXT
{
Funzione = funz,
Period = periodo,
UM = item.Value.unit,
DTStart = DateTime.Now.AddHours(-1),
dataArray = new List<double>()
};
+2 -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);
@@ -211,6 +209,7 @@ namespace IOB_WIN_NEXT
if (adpRunning)
{
lgInfo("Connessione OK");
lastReadPLC = DateTime.Now;
}
}
else
@@ -269,6 +268,7 @@ namespace IOB_WIN_NEXT
sw.Start();
elencoSyncState = dbProxy.DataController.SyncStateDoImportAll();
sw.Stop();
lastReadPLC = DateTime.Now;
lgInfo($"DB: esecuzione task dbProxy.DataController.SyncStateGetAll() in {sw.ElapsedMilliseconds} ms");
if (elencoSyncState != null)
+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
+198 -171
View File
@@ -238,28 +238,11 @@ namespace IOB_WIN_NEXT
}
catch (Exception exc)
{
lgError(exc, "Errore in getDynData x ModBus TCP PLC --> ciclo disconnect/reconnect | LUT: {useLUT}");
lgError(exc, $"Errore in getDynData x ModBus TCP PLC --> ciclo disconnect/reconnect | LUT: {useLUT}{Environment.NewLine}{exc}");
tryDisconnect();
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
@@ -540,15 +523,16 @@ namespace IOB_WIN_NEXT
/// </summary>
/// <param name="startAddr"></param>
/// <param name="currRegVal">Valore in formato INT da registri</param>
/// <param name="baseAddr">Indirizzo di base dei registri</param>
/// <returns></returns>
public bool writeInputReg(int startAddr, int[] currRegVal)
public bool writeInputReg(int startAddr, int[] currRegVal, int baseAddr)
{
bool answ = false;
if (currPLC.Connected)
{
try
{
currPLC.WriteMultipleRegisters(startAddr + deltaBase, currRegVal);
currPLC.WriteMultipleRegisters(startAddr + deltaBase + (40000 - baseAddr), currRegVal);
answ = true;
}
catch
@@ -598,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...)
@@ -677,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>
@@ -744,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>
@@ -797,13 +696,35 @@ namespace IOB_WIN_NEXT
CurrVal = ModbusClient.ConvertIntToRegisters(valInt);
}
fatto = writeInputReg(currMem.index, CurrVal);
fatto = writeInputReg(currMem.index, CurrVal, parametri.holdRegBaseAddr);
break;
case plcDataType.IntLH:
valInt = getScaledInt(currMem, true);
if (byteSize == 1)
{
CurrVal[1] = valInt;
}
else
{
CurrVal = ModbusClient.ConvertIntToRegisters(valInt);
Array.Reverse(CurrVal);
}
fatto = writeInputReg(currMem.index, CurrVal, parametri.holdRegBaseAddr);
break;
case plcDataType.DInt:
valUInt = getScaledUInt(currMem, true);
CurrVal = ModbusClient.ConvertLongToRegisters(valInt);
fatto = writeInputReg(currMem.index, CurrVal);
fatto = writeInputReg(currMem.index, CurrVal, parametri.holdRegBaseAddr);
break;
case plcDataType.DIntLH:
valUInt = getScaledUInt(currMem, true);
CurrVal = ModbusClient.ConvertLongToRegisters(valInt);
Array.Reverse(CurrVal);
fatto = writeInputReg(currMem.index, CurrVal, parametri.holdRegBaseAddr);
break;
//case plcDataType.Word:
@@ -817,19 +738,27 @@ namespace IOB_WIN_NEXT
// break;
case plcDataType.Real:
case plcDataType.RealHL:
valDouble = getScaledDouble(currMem);
CurrVal = ModbusClient.ConvertFloatToRegisters((float)valDouble, ModbusClient.RegisterOrder.HighLow);
fatto = writeInputReg(currMem.index, CurrVal);
fatto = writeInputReg(currMem.index, CurrVal, parametri.holdRegBaseAddr);
break;
//case plcDataType.String:
// // se ho writePre --> "allungo" di 2 la dimensione della stringa x MemBlock...
// if (writePre)
// {
// MemBlock = new byte[byteSize + 2];
// }
// saveStringOnMemBlock(ref MemBlock, 0, currMem.size, currMem.value);
// break;
case plcDataType.FloatBADC:
case plcDataType.RealLH:
valDouble = getScaledDouble(currMem);
CurrVal = ModbusClient.ConvertFloatToRegisters((float)valDouble, ModbusClient.RegisterOrder.LowHigh);
fatto = writeInputReg(currMem.index, CurrVal, parametri.holdRegBaseAddr);
break;
case plcDataType.String:
CurrVal = ModbusClient.ConvertStringToRegisters(currMem.value.PadRight(currMem.size * 2));
var regLen = ModbusClient.ConvertIntToRegisters(currMem.size * 2 - 2);
Array.Copy(regLen, 0, CurrVal, CurrVal.Length - regLen.Length, regLen.Length);
//CurrVal[CurrVal.Length - 2] = regLen[1];
//CurrVal[CurrVal.Length - 1] = regLen[0];
fatto = writeInputReg(currMem.index, CurrVal, parametri.holdRegBaseAddr);
break;
default:
break;
@@ -864,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>
@@ -876,7 +834,7 @@ namespace IOB_WIN_NEXT
// SE è necessario refresh...
if (needRefresh)
{
lgInfoStartup("Refreshing connection...");
lgInfo("Refreshing connection...");
if (parametri != null)
{
try
@@ -1137,6 +1095,7 @@ namespace IOB_WIN_NEXT
switch (tipoMem)
{
case plcDataType.Real:
case plcDataType.RealHL:
case plcDataType.FloatABCD:
if (size == 4)
{
@@ -1148,16 +1107,17 @@ namespace IOB_WIN_NEXT
}
break;
case plcDataType.RealLH:
case plcDataType.FloatCDAB:
if (size == 4)
{
// invero array...
// inverto array...
Array.Reverse(listInt);
valore = ModbusClient.ConvertRegistersToDouble(listInt);
}
else if (size == 2)
{
// non serve cambaire nulla...
// inverto array...
Array.Reverse(listInt);
valore = ModbusClient.ConvertRegistersToFloat(listInt);
}
@@ -1191,6 +1151,20 @@ namespace IOB_WIN_NEXT
valore = listInt[0];
}
break;
case plcDataType.IntLH:
case plcDataType.DIntLH:
if (size == 4)
{
Array.Reverse(listInt);
valore = ModbusClient.ConvertRegistersToLong(listInt);
}
else if (size == 2)
{
Array.Reverse(listInt);
valore = ModbusClient.ConvertRegistersToInt(listInt);
}
break;
}
return valore;
}
@@ -1207,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>
@@ -1233,6 +1206,10 @@ namespace IOB_WIN_NEXT
valInt = (int)(temp * 10 * currMem.factor) / 10;
}
}
else
{
valInt = (int)temp;
}
return valInt;
}
@@ -1292,11 +1269,13 @@ namespace IOB_WIN_NEXT
// procedo x ogni valore configurato...
foreach (var item in memItemList)
{
listInt = new int[item.Value.size];
// attesa 50 ms prima di procedere x evitare burst dati
if (!useLUT)
{
Thread.Sleep(50);
}
string valString = "";
double valore = 0;
double valoreScal = 0;
bool dataOk = false;
@@ -1318,7 +1297,16 @@ namespace IOB_WIN_NEXT
case modBusAddrType.InputRegister:
listInt = readInputReg(item.Value.index, item.Value.size);
valore = convertFromReg(listInt, item.Value.size, item.Value.tipoMem);
if (item.Value.tipoMem == plcDataType.String)
{
// valore string...
valString = ModbusClient.ConvertRegistersToString(listInt, 0, item.Value.size);
}
else
{
// valori numerici...
valore = convertFromReg(listInt, item.Value.size, item.Value.tipoMem);
}
break;
@@ -1346,7 +1334,18 @@ namespace IOB_WIN_NEXT
{
try
{
listInt = HoldingRegisterLUT[lutAddress];
if (listInt.Length == 2)
{
listInt = HoldingRegisterLUT[lutAddress];
}
else
{
// faccio ciclo x copiare 2 alla volta...
for (int i = 0; i < listInt.Length; i += 2)
{
Array.Copy(HoldingRegisterLUT[lutAddress + i], 0, listInt, i, 2);
}
}
}
catch (Exception exc)
{
@@ -1359,26 +1358,53 @@ namespace IOB_WIN_NEXT
{
listInt = readHoldReg(item.Value.index - 1, item.Value.size);
}
valore = convertFromReg(listInt, item.Value.size, item.Value.tipoMem);
if (item.Value.tipoMem == plcDataType.String)
{
// valore string...
valString = ModbusClient.ConvertRegistersToString(listInt, 0, item.Value.size);
valString = valString.Replace("\n", "").Replace("\r", "").Replace("\0", string.Empty).Trim();
}
else
{
valore = convertFromReg(listInt, item.Value.size, item.Value.tipoMem);
}
break;
default:
break;
}
// verifica limite... con delta da impianto
dataOk = (valore > (item.Value.minVal + deltaVal) && valore < (item.Value.maxVal - deltaVal));
if (dataOk || disDynDataRangeCheck)
if (item.Value.tipoMem == plcDataType.String)
{
// moltiplico x fattore conversione...
valoreScal = valore * item.Value.factor;
saveValue(ref outVal, valoreScal, item.Key);
lgDebug($"getDataDictionary: valore ricevuto | {item.Key} | val: {valore} | valoreScal: {valoreScal}");
saveValueString(ref outVal, valString, item.Key);
lgDebug($"getDataDictionary: valore ricevuto | {item.Key} | val: {valString}");
}
else
{
lgError($"getDataDictionary: valore scartato x limiti min/max | {item.Key} | val: {valore} | valoreScal: {valoreScal} | min-max: {item.Value.minVal}-{item.Value.maxVal} | deltaVal: {deltaVal}");
readErrorList.Add(item.Key, item.Value);
lgDebug($"--> rimesso in coda lettura | parametro: {item.Key} | index: {item.Value.index} | size: {item.Value.size}");
// verifica limite... con delta da impianto
dataOk = (valore > (item.Value.minVal + deltaVal) && valore < (item.Value.maxVal - deltaVal));
if (dataOk || disDynDataRangeCheck)
{
// verifica valori EPOCH x convertirli in datetime...
if (item.Value.unit == "EPOCH")
{
valString = TimeUtils.epochConvert(valore).ToString("yyyy-MM-dd HH:mm:ss");
saveValueString(ref outVal, valString, item.Key);
lgDebug($"getDataDictionary: valore EPOCH ricevuto | {item.Key} | val: {valore} | valString: {valString}");
}
else
{
// moltiplico x fattore conversione...
valoreScal = valore * item.Value.factor;
saveValue(ref outVal, valoreScal, item.Key);
lgDebug($"getDataDictionary: valore ricevuto | {item.Key} | val: {valore} | valoreScal: {valoreScal}");
}
}
else
{
lgError($"getDataDictionary: valore scartato x limiti min/max | {item.Key} | val: {valore} | valoreScal: {valoreScal} | min-max: {item.Value.minVal}-{item.Value.maxVal} | deltaVal: {deltaVal}");
readErrorList.Add(item.Key, item.Value);
lgDebug($"--> rimesso in coda lettura | parametro: {item.Key} | index: {item.Value.index} | size: {item.Value.size}");
}
}
}
@@ -1419,7 +1445,7 @@ namespace IOB_WIN_NEXT
/// Effettua lettura blocco memoria indicato e lo salva in copia locale HoldingRegisterLUT
/// </summary>
/// <param name="startAddr">Indirizzo di partenza</param>
/// <param name="numReg">NUm registri da leggere (max 120)</param>
/// <param name="numReg">Num registri da leggere (max 120)</param>
private void readBlockHoldingReg(int startAddr, int numReg, int baseAddr)
{
bool allOk = false;
@@ -1441,6 +1467,7 @@ namespace IOB_WIN_NEXT
rawData = currPLC.ReadHoldingRegisters(startAddr - baseAddr, numReg);
stopwatch.Stop();
lgTrace($"Lettura in blocco HoldingRegisters| startAddr: {startAddr} | numReg {numReg} | rawData.lenght: {rawData.Length} | {stopwatch.ElapsedMilliseconds}ms");
lastReadPLC = DateTime.Now;
// salvo in LUT la versione ESPLOSA 2 byte alla volta...
if (rawData.Length > 0)
{
@@ -1474,7 +1501,7 @@ namespace IOB_WIN_NEXT
{
currReadErrors++;
allOk = false;
lgError($"Eccezione in readBlockHoldingReg | currReadErrors: {currReadErrors}{Environment.NewLine}{exc}");
lgError($"Eccezione in readBlockHoldingReg | startAddr: {startAddr} | baseAddr: {baseAddr} | numReg: {numReg} | currReadErrors: {currReadErrors} |{Environment.NewLine}{exc}");
}
}
else
+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
}
}
+84 -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,50 +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
}
}

Some files were not shown because too many files have changed in this diff Show More