diff --git a/IOB-WIN-MBUS/DATA/CONF/MAIN.ini b/IOB-WIN-MBUS/DATA/CONF/MAIN.ini index ebfdae50..774b904d 100644 --- a/IOB-WIN-MBUS/DATA/CONF/MAIN.ini +++ b/IOB-WIN-MBUS/DATA/CONF/MAIN.ini @@ -26,6 +26,6 @@ CLI_INST=SteamWareSim ;STARTLIST=PIZ04 ;STARTLIST=4001-ENR ;STARTLIST=3029-ENR -STARTLIST=3010-ENR +STARTLIST=_FRER MAXCNC=10 \ No newline at end of file diff --git a/IOB-WIN-MBUS/DATA/CONF/_FRER.ini b/IOB-WIN-MBUS/DATA/CONF/_FRER.ini index bb47a62e..d0e9e191 100644 --- a/IOB-WIN-MBUS/DATA/CONF/_FRER.ini +++ b/IOB-WIN-MBUS/DATA/CONF/_FRER.ini @@ -15,7 +15,7 @@ VENDOR=FRER MODEL=MCIMIDETH [CNC] -IP=192.168.0.999 +IP=192.168.0.154 PORT=502 [SERVER] @@ -66,16 +66,16 @@ FORCE_DYN_DATA=TRUE DELTA_VAL=0.1 ; clock base (da 10ms) -timerIntMs=10 +timerIntMs=50 ; conf parametri memoria READ/WRITE -PARAM_CONF=999999-ENR.json +PARAM_CONF=_FRER.json NO_PING=FALSE ; conf blocchi memoria x READ -MEM_BLOCK=999999-ENR_MBlock.json -;; conf aree allarme -;ALARM_CONF=999999-ENR_alarm.json +MEM_BLOCK=_FRER_MBlock.json +VETO_SIG_IN=true +DISAB_KEEPALIVE=true ; rimozione check limiti min/max dynData disDynDataRangeCheck=true diff --git a/IOB-WIN-MBUS/DATA/CONF/_FRER.json b/IOB-WIN-MBUS/DATA/CONF/_FRER.json index d53dd7d4..a515c29d 100644 --- a/IOB-WIN-MBUS/DATA/CONF/_FRER.json +++ b/IOB-WIN-MBUS/DATA/CONF/_FRER.json @@ -11,7 +11,7 @@ "index": 4096, "size": 2, "func": "MEDIAN", - "period": 300, + "period": 3600, "factor": 1, "minVal": 0, "maxVal": 500, @@ -25,7 +25,7 @@ "index": 4098, "size": 2, "func": "MEDIAN", - "period": 300, + "period": 3600, "factor": 1, "minVal": 0, "maxVal": 500, @@ -39,7 +39,7 @@ "index": 4100, "size": 2, "func": "MEDIAN", - "period": 300, + "period": 3600, "factor": 1, "minVal": 0, "maxVal": 500, @@ -53,7 +53,7 @@ "index": 4102, "size": 2, "func": "MEDIAN", - "period": 300, + "period": 3600, "factor": 1, "minVal": 0, "maxVal": 500, @@ -67,7 +67,7 @@ "index": 4104, "size": 2, "func": "MEDIAN", - "period": 300, + "period": 3600, "factor": 1, "minVal": 0, "maxVal": 500, @@ -81,7 +81,7 @@ "index": 4106, "size": 2, "func": "MEDIAN", - "period": 300, + "period": 3600, "factor": 1, "minVal": 0, "maxVal": 500, @@ -95,7 +95,7 @@ "index": 4108, "size": 2, "func": "MEDIAN", - "period": 300, + "period": 3600, "factor": 1, "minVal": 0, "maxVal": 500, @@ -109,7 +109,7 @@ "index": 4110, "size": 2, "func": "MEDIAN", - "period": 300, + "period": 3600, "factor": 1, "minVal": 0, "maxVal": 500, @@ -123,7 +123,7 @@ "index": 4112, "size": 2, "func": "MEDIAN", - "period": 300, + "period": 3600, "factor": 1, "minVal": 0, "maxVal": 500, @@ -137,7 +137,7 @@ "index": 4114, "size": 2, "func": "MEDIAN", - "period": 300, + "period": 3600, "factor": 1, "minVal": 0, "maxVal": 500, @@ -151,7 +151,7 @@ "index": 4116, "size": 2, "func": "MEDIAN", - "period": 300, + "period": 3600, "factor": 1, "minVal": 0, "maxVal": 500, @@ -165,7 +165,7 @@ "index": 4118, "size": 2, "func": "MEDIAN", - "period": 300, + "period": 3600, "factor": 1, "minVal": 0, "maxVal": 500, @@ -179,7 +179,7 @@ "index": 4134, "size": 2, "func": "MEDIAN", - "period": 300, + "period": 3600, "factor": 1, "minVal": 0, "maxVal": 500, @@ -193,7 +193,7 @@ "index": 4142, "size": 2, "func": "MEDIAN", - "period": 300, + "period": 3600, "factor": 1, "minVal": 0, "maxVal": 500, @@ -207,7 +207,7 @@ "index": 4150, "size": 2, "func": "MEDIAN", - "period": 300, + "period": 3600, "factor": 1, "minVal": 0, "maxVal": 500, @@ -220,8 +220,8 @@ "tipoMem": "RealHL", "index": 4352, "size": 2, - "func": "MAX", - "period": 300, + "func": "MEDIAN", + "period": 3600, "factor": 1, "minVal": 0, "maxVal": 999999999, @@ -234,8 +234,8 @@ "tipoMem": "RealHL", "index": 4354, "size": 2, - "func": "MAX", - "period": 300, + "func": "MEDIAN", + "period": 3600, "factor": 1, "minVal": 0, "maxVal": 999999999, @@ -248,8 +248,8 @@ "tipoMem": "RealHL", "index": 4356, "size": 2, - "func": "MAX", - "period": 300, + "func": "MEDIAN", + "period": 3600, "factor": 1, "minVal": 0, "maxVal": 999999999, @@ -262,8 +262,8 @@ "tipoMem": "RealHL", "index": 4358, "size": 2, - "func": "MAX", - "period": 300, + "func": "MEDIAN", + "period": 3600, "factor": 1, "minVal": 0, "maxVal": 999999999, @@ -276,8 +276,8 @@ "tipoMem": "RealHL", "index": 4142, "size": 2, - "func": "MAX", - "period": 60, + "func": "MEDIAN", + "period": 600, "factor": 0.001, "minVal": 0, "maxVal": 999999999, @@ -291,17 +291,12 @@ "tipoMem": "RealHL", "index": 4358, "size": 2, - "func": "MAX", - "period": 60, + "func": "MEDIAN", + "period": 600, "factor": 0.001, - "minVal": 0, + "minVal": 0.01, "maxVal": 999999999, "unit": "KWh" } } - //"optKVP": { - // "fluxLogReduce": true, - // "fluxLogRedDeadBand": 1.0, - // "fluxLogResendPeriod": 600 - //} } \ No newline at end of file diff --git a/IOB-WIN-MBUS/IOB-WIN-MBUS.csproj b/IOB-WIN-MBUS/IOB-WIN-MBUS.csproj index bc23bb06..c8edfd08 100644 --- a/IOB-WIN-MBUS/IOB-WIN-MBUS.csproj +++ b/IOB-WIN-MBUS/IOB-WIN-MBUS.csproj @@ -190,15 +190,9 @@ - - Always - - - Always - - - Always - + + + @@ -248,27 +242,15 @@ - - PreserveNewest - - - PreserveNewest - + + - - PreserveNewest - - - Always - - - Always - - - Always - + + + + @@ -442,9 +424,15 @@ Always - - - + + Always + + + Always + + + Always + Always diff --git a/IOB-WIN-MBUS/IobModbustTCP/ModbusTCP.cs b/IOB-WIN-MBUS/IobModbustTCP/ModbusTCP.cs index 8c3a281d..6a8ac4e1 100644 --- a/IOB-WIN-MBUS/IobModbustTCP/ModbusTCP.cs +++ b/IOB-WIN-MBUS/IobModbustTCP/ModbusTCP.cs @@ -58,6 +58,17 @@ namespace IOB_WIN_MBUS.IobModbusTCP }; #endif setParamPlc(); + // + string sMinWait = getOptPar("minWait"); + if (!string.IsNullOrEmpty(sMinWait)) + { + int.TryParse(sMinWait, out minWait); + } + string sMaxWait = getOptPar("maxWait"); + if (!string.IsNullOrEmpty(sMaxWait)) + { + int.TryParse(sMaxWait, out maxWait); + } // salvo info su conf IOB... string iobConfSer = ""; @@ -75,7 +86,14 @@ namespace IOB_WIN_MBUS.IobModbusTCP lgError("Impossibile avviare, IOBConf nullo/non valido!"); } } - + /// + /// Min attesa chiamate consecutive ModBus + /// + private int minWait = 40; + /// + /// Max attesa chiamate consecutive ModBus + /// + private int maxWait = 60; #endregion Public Constructors #region Public Methods @@ -217,18 +235,7 @@ namespace IOB_WIN_MBUS.IobModbusTCP public override Dictionary getDynData() { Random rnd = new Random(); - int minWait = 40; - int maxWait = 60; - string sMinWait = getOptPar("minWait"); - if (!string.IsNullOrEmpty(sMinWait)) - { - int.TryParse(sMinWait, out minWait); - } - string sMaxWait = getOptPar("minWait"); - if (!string.IsNullOrEmpty(sMaxWait)) - { - int.TryParse(sMaxWait, out maxWait); - } + // valore non presente in vers default... se gestito fare override Dictionary outVal = new Dictionary(); if (utils.CRB("enableTSVC"))