From c691a677d207c7ea00ea220cff430d9826edbc78 Mon Sep 17 00:00:00 2001 From: "S.E.Locatelli" Date: Wed, 13 Jul 2022 18:10:05 +0200 Subject: [PATCH] =?UTF-8?q?centerfrigo:=20-=20update=20conf=20e=20scrittur?= =?UTF-8?q?a=20real=20-=20=C3=A8=20LowHigh=20(NON=20HighLow)=20-=20da=20ag?= =?UTF-8?q?giornare=20SDK?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IOB-WIN-NEXT/DATA/CONF/GIACO_CENTERFRIGO.json | 72 ++++++++++++++++--- IOB-WIN-NEXT/DATA/CONF/MAIN.ini | 2 +- IOB-WIN-NEXT/IobModbusTCP.cs | 6 ++ 3 files changed, 71 insertions(+), 9 deletions(-) diff --git a/IOB-WIN-NEXT/DATA/CONF/GIACO_CENTERFRIGO.json b/IOB-WIN-NEXT/DATA/CONF/GIACO_CENTERFRIGO.json index 7b06ce3d..3d53fc48 100644 --- a/IOB-WIN-NEXT/DATA/CONF/GIACO_CENTERFRIGO.json +++ b/IOB-WIN-NEXT/DATA/CONF/GIACO_CENTERFRIGO.json @@ -1,17 +1,73 @@ { "mMapWrite": { - "TestWrite": { - "name": "TestWrite", - "description": "Test Scrittura", - "memAddr": "41621", - "tipoMem": "Real", - "index": 1621, + "TestWrite01": { + "name": "TestWrite01", + "description": "Test Scrittura 01", + "memAddr": "44010", + "tipoMem": "FloatBADC", + "index": 4010, "size": 2, "func": "MEDIAN", "period": 60, "factor": 1, - "minVal": -100, - "maxVal": 100, + "minVal": 0, + "maxVal": 15, + "unit": "°C" + }, + "TestWrite02": { + "name": "TestWrite02", + "description": "Test Scrittura 02", + "memAddr": "44012", + "tipoMem": "FloatBADC", + "index": 4012, + "size": 2, + "func": "MEDIAN", + "period": 60, + "factor": 1, + "minVal": 0, + "maxVal": 15, + "unit": "°C" + }, + "TestWrite03": { + "name": "TestWrite03", + "description": "Test Scrittura 03", + "memAddr": "44014", + "tipoMem": "FloatBADC", + "index": 4014, + "size": 2, + "func": "MEDIAN", + "period": 60, + "factor": 1, + "minVal": 0, + "maxVal": 15, + "unit": "°C" + }, + "TestWrite04": { + "name": "TestWrite04", + "description": "Test Scrittura 04", + "memAddr": "44016", + "tipoMem": "FloatBADC", + "index": 4016, + "size": 2, + "func": "MEDIAN", + "period": 60, + "factor": 1, + "minVal": 0, + "maxVal": 15, + "unit": "°C" + }, + "TestWrite05": { + "name": "TestWrite05", + "description": "Test Scrittura 05", + "memAddr": "44018", + "tipoMem": "FloatBADC", + "index": 4018, + "size": 2, + "func": "MEDIAN", + "period": 60, + "factor": 1, + "minVal": 0, + "maxVal": 15, "unit": "°C" }, "SetPoint_Tunnel": { diff --git a/IOB-WIN-NEXT/DATA/CONF/MAIN.ini b/IOB-WIN-NEXT/DATA/CONF/MAIN.ini index 54d5fe95..8de8fe46 100644 --- a/IOB-WIN-NEXT/DATA/CONF/MAIN.ini +++ b/IOB-WIN-NEXT/DATA/CONF/MAIN.ini @@ -38,6 +38,6 @@ CLI_INST=SteamWareSim ;STARTLIST=GIACO_ICOEL_002 ;STARTLIST=GIACO_CENTERFRIGO ;STARTLIST=GIACO_NWSE -STARTLIST=SIMUL_01 +STARTLIST=GIACO_CENTERFRIGO MAXCNC=10 \ No newline at end of file diff --git a/IOB-WIN-NEXT/IobModbusTCP.cs b/IOB-WIN-NEXT/IobModbusTCP.cs index 6f6de41f..9f8e8a57 100644 --- a/IOB-WIN-NEXT/IobModbusTCP.cs +++ b/IOB-WIN-NEXT/IobModbusTCP.cs @@ -822,6 +822,12 @@ namespace IOB_WIN_NEXT fatto = writeInputReg(currMem.index, CurrVal); break; + case plcDataType.FloatBADC: + valDouble = getScaledDouble(currMem); + CurrVal = ModbusClient.ConvertFloatToRegisters((float)valDouble, ModbusClient.RegisterOrder.LowHigh); + fatto = writeInputReg(currMem.index, CurrVal); + break; + //case plcDataType.String: // // se ho writePre --> "allungo" di 2 la dimensione della stringa x MemBlock... // if (writePre)