From 1ce5288e696fee511154b03c5d1fa90fae534fd6 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Wed, 30 Oct 2019 19:49:39 +0100 Subject: [PATCH] Altro test OUTPUT --- IOB-WIN/IobOmron.cs | 60 ++++++++++++++++++++++++++++++++++++--------- Jenkinsfile | 2 +- 2 files changed, 49 insertions(+), 13 deletions(-) diff --git a/IOB-WIN/IobOmron.cs b/IOB-WIN/IobOmron.cs index 6aba502e..ea663c8d 100644 --- a/IOB-WIN/IobOmron.cs +++ b/IOB-WIN/IobOmron.cs @@ -632,8 +632,6 @@ namespace IOB_WIN parentForm.sIN = Semaforo.SV; - // leggo e scrivo LOG... - readAndLog(); // effettuo TUTTE le letture cStatus = currBitmapStatus; @@ -645,6 +643,7 @@ namespace IOB_WIN private void readAndLog() { +#if false short[] response1; short[] response2; short bit1; @@ -655,20 +654,50 @@ namespace IOB_WIN // esempio 12540 --> diviso in 1 | 2540 --> in HEX diventa 1 | 9472, ma il 9472 va su byte[0] e 1 su byte[1] +#endif - short[] response0; - OMRON_ref.ReadWords(OmronFinsTCP.Net.PlcMemory.DM, 0, 5, out response0); + short[] responseCIO; + short[] responseDM; + short[] responseWR; + OMRON_ref.ReadWords(OmronFinsTCP.Net.PlcMemory.CIO, 0, 8, out responseCIO); + OMRON_ref.ReadWords(OmronFinsTCP.Net.PlcMemory.DM, 0, 8, out responseDM); + OMRON_ref.ReadWords(OmronFinsTCP.Net.PlcMemory.WR, 0, 8, out responseWR); - if (periodicLog) + lgInfo("Effettuata lettura dati CIO"); + foreach (var item in responseCIO) { - lgInfo($"Effettuata lettura dati: {response0}"); - foreach (var item in response0) - { - lgInfo($"Valori: {item} --> {baseUtils.binaryForm(item)}"); - } - + lgInfo($"Valori: {item} --> {baseUtils.binaryForm(item)}"); } + lgInfo("Effettuata lettura dati DM"); + foreach (var item in responseDM) + { + lgInfo($"Valori: {item} --> {baseUtils.binaryForm(item)}"); + } + lgInfo("Effettuata lettura dati WR"); + foreach (var item in responseWR) + { + lgInfo($"Valori: {item} --> {baseUtils.binaryForm(item)}"); + } + + + + short[] respDM20; + short[] respDM22; + OMRON_ref.ReadWords(OmronFinsTCP.Net.PlcMemory.DM, 20, 2, out respDM20); + OMRON_ref.ReadWords(OmronFinsTCP.Net.PlcMemory.DM, 22, 2, out respDM22); + // legge delle coppie di valori INT, vanno trasformati in HEX e POI accodati, dove il primo รจ x 1 e il secondo x 10000 (in pratica va in testa) + lgInfo("Effettuata lettura dati respDM20"); + foreach (var item in respDM20) + { + lgInfo($"Valori: {item} --> {baseUtils.binaryForm(item)}"); + } + lgInfo("Effettuata lettura dati respDM22"); + foreach (var item in respDM22) + { + lgInfo($"Valori: {item} --> {baseUtils.binaryForm(item)}"); + } + } /// @@ -810,8 +839,15 @@ namespace IOB_WIN // valore non presente in vers default... se gestito fare override Dictionary outVal = new Dictionary(); outVal.Add("NUM_PZ_PREL", pzPrelevati.ToString()); +#if false outVal.Add("NUM_PZ_LAV", pzCounter.ToString()); - outVal.Add("CURR_SIGNALS", currBitmapSignals.ToString()); + outVal.Add("CURR_SIGNALS", currBitmapSignals.ToString()); +#endif + + // leggo e scrivo LOG... + readAndLog(); + + return outVal; } diff --git a/Jenkinsfile b/Jenkinsfile index 20d55f12..ae398ecf 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,7 +16,7 @@ pipeline { /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ script { - withEnv(['NEXT_BUILD_NUMBER=481']) { + withEnv(['NEXT_BUILD_NUMBER=482']) { // env.versionNumber = VersionNumber(versionNumberString : '2.3.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true) env.versionNumber = VersionNumber(versionNumberString : '2.3.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') env.APP_NAME = 'MAPO-IOB-WIN'