KA 합산 값을 1000 배하여 Indicator 로 전송

This commit is contained in:
shark219-hub
2024-11-28 17:31:14 +09:00
parent 1ff549ed75
commit c4319f52d0
6 changed files with 27 additions and 42 deletions

View File

@@ -55,9 +55,15 @@ namespace vmsnet
//데이터를 요청하고 처리하는 코드 필요
RUN_GETDATA();
/* 데이터형식 : PUB.Values[mc, unit, ch-1]
* 전해조A [CH2] : PUB.Values[0, 0, 2-1] : 3002
* [CH2] 실제값 : 3.002
*/
//인디케이터 디스플레이
if (PUB.indicator.IsOpen)
{
var _ampdecpos = 3;
PUB.KA1_SUM = 0f;
foreach(var item in PUB.KA1_IndexList)
{
@@ -68,13 +74,9 @@ namespace vmsnet
try
{
var _ampdecpos = 3;
PUB.KA1_SUM += (float)(PUB.Values[di1, di2, di3 - 1] / (Math.Pow(10, _ampdecpos)));
}
catch
{
}
catch { }
}
PUB.KA2_SUM = 0f;
@@ -87,15 +89,14 @@ namespace vmsnet
try
{
var _ampdecpos = 3;
PUB.KA2_SUM += (float)(PUB.Values[di1, di2, di3 - 1] / (Math.Pow(10, _ampdecpos)));
}
catch
{
}
catch { }
}
var SUMKA = PUB.KA1_SUM + PUB.KA2_SUM;
// '9.000 × 1,000 = 9,000' 식처럼 1000 배 만든다.
var SUMKA = (PUB.KA1_SUM + PUB.KA2_SUM) * (Math.Pow(10, _ampdecpos));
// '9,000'을 전송한 후 Indicator 에서 왼쪽으로 소수점을 '3' 칸 이동시켜서 Display 하는 작업이 필요
PUB.indicator.SetKA((Int32)SUMKA);
}
return StepResult.Wait;