From 2231e1e1c400a15d07cbd204effbdcfc83804414 Mon Sep 17 00:00:00 2001 From: Nicola Date: Thu, 17 Jun 2021 08:56:19 +0200 Subject: [PATCH] FIx analog values (float) --- MTC_Adapter/SCMA/AdapterPLC/Generic.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MTC_Adapter/SCMA/AdapterPLC/Generic.cs b/MTC_Adapter/SCMA/AdapterPLC/Generic.cs index 0fe1695..457806d 100644 --- a/MTC_Adapter/SCMA/AdapterPLC/Generic.cs +++ b/MTC_Adapter/SCMA/AdapterPLC/Generic.cs @@ -4626,7 +4626,7 @@ namespace SCMA.AdapterPLC // gestisco in modalità "lazy" qualsiasi variabile (dividendo x opportuno fattore conversione...) try { - analogVal = tabDatiAnag[idxTab] / utils.CRI("fattDecVA"); + analogVal = (double)tabDatiAnag[idxTab] / (double)utils.CRI("fattDecVA"); } catch (Exception exc) { @@ -4664,7 +4664,7 @@ namespace SCMA.AdapterPLC // gestisco in modalità "lazy" qualsiasi variabile (dividendo x opportuno fattore conversione...) try { - analogVal = tabDatiAnag[idxTab] / utils.CRI("fattDecVA"); + analogVal = (double) tabDatiAnag[idxTab] / (double) utils.CRI("fattDecVA"); } catch (Exception exc) {