Merge branch 'release/UpdateWaitRandom'

This commit is contained in:
Samuele Locatelli
2022-06-21 19:01:30 +02:00
4 changed files with 56 additions and 4 deletions
@@ -60,6 +60,8 @@ DELTA_VAL=0.1
; clock base (da 10ms)
timerIntMs=100
minWait=50
maxWait=150
; conf parametri memoria READ/WRITE
PARAM_CONF=GIACO_CENTERFRIGO.json
+45 -3
View File
@@ -2,15 +2,57 @@
"mMapWrite": {
},
"mMapRead": {
"TempTunnel": {
"name": "TempTunnel",
"Temp_Tunnel": {
"name": "Temp_Tunnel",
"description": "Temperatura Tunnel",
"memAddr": "41520",
"tipoMem": "Real",
"index": 1520,
"size": 2,
"func": "MEDIAN",
"period": 10,
"period": 60,
"factor": 1,
"minVal": -100,
"maxVal": 100,
"unit": "°C"
},
"SetPoint_Tunnel": {
"name": "SetPoint_Tunnel",
"description": "Setpoint Tunnel",
"memAddr": "41560",
"tipoMem": "Real",
"index": 1560,
"size": 2,
"func": "MEDIAN",
"period": 60,
"factor": 1,
"minVal": -100,
"maxVal": 100,
"unit": "°C"
},
"Temp_Cella_01": {
"name": "Temp_Cella_01",
"description": "Temperatura Cella 01",
"memAddr": "41660",
"tipoMem": "Real",
"index": 1660,
"size": 2,
"func": "MEDIAN",
"period": 60,
"factor": 1,
"minVal": -100,
"maxVal": 100,
"unit": "°C"
},
"SetPoint_Cella_01": {
"name": "SetPoint_Cella_01",
"description": "Setpoint Cella 01",
"memAddr": "41700",
"tipoMem": "Real",
"index": 1700,
"size": 2,
"func": "MEDIAN",
"period": 60,
"factor": 1,
"minVal": -100,
"maxVal": 100,
+7 -1
View File
@@ -174,6 +174,11 @@ namespace IOB_WIN_NEXT
/// </summary>
public override Dictionary<string, string> getDynData()
{
Random rnd = new Random();
int minWait = 50;
int maxWait = 50;
int.TryParse(getOptPar("minWait"), out minWait);
int.TryParse(getOptPar("maxWait"), out maxWait);
// valore non presente in vers default... se gestito fare override
Dictionary<string, string> outVal = new Dictionary<string, string>();
if (utils.CRB("enableTSVC"))
@@ -194,7 +199,8 @@ namespace IOB_WIN_NEXT
foreach (var item in memSetR)
{
readBlockHoldingReg(item.Key, item.Value, parametri.holdRegBaseAddr);
Thread.Sleep(100);
int waitTime = rnd.Next(minWait, maxWait);
Thread.Sleep(waitTime);
}
}
// procedo ...
+2
View File
@@ -23,6 +23,8 @@ 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
*
* -------------------------------------------------------------------------------- */