From 08e53c090e09c463aeaab2f7f9ca9e94e4188784 Mon Sep 17 00:00:00 2001 From: Milan Hanajik Date: Fri, 20 Feb 2015 11:37:09 +0100 Subject: [PATCH] PMaxTest and LeakTest improvements: - result items P_xy_start and P_xy_end added - DurationLeak test parameter for LeakTest method - correct default parameters for Danfoss.VLT2800.Pump (FC protocol) - bug fixes --- .../BenchControl/Danfoss/VLT2800/Pump.cs | 1 + .../BenchControl/Danfoss/VLT2800/PumpCfg.cs | 14 +- TestBenchFramework/BenchControl/Events.cs | 14 +- .../BenchControl/Sequences/SequenceBase.cs | 8 +- .../TestMethods/LeakTest/LeakTestParams.cs | 35 ++- .../TestMethods/LeakTest/LeakTestSeq.cs | 292 +++++++++++------- .../TestMethods/PMaxTest/PMaxTestParams.cs | 26 +- .../TestMethods/PMaxTest/PMaxTestSeq.cs | 90 +++--- TestBenchFramework/Forms/ResultItemSpec.cs | 12 +- .../Resources/Strings.Designer.cs | 67 +++- TestBenchFramework/Resources/Strings.de.resx | 12 + TestBenchFramework/Resources/Strings.resx | 25 +- .../Screens/ProcessTabPageCtrl.cs | 16 +- 13 files changed, 395 insertions(+), 217 deletions(-) diff --git a/TestBenchFramework/BenchControl/Danfoss/VLT2800/Pump.cs b/TestBenchFramework/BenchControl/Danfoss/VLT2800/Pump.cs index f87de2601..61a5a20ec 100644 --- a/TestBenchFramework/BenchControl/Danfoss/VLT2800/Pump.cs +++ b/TestBenchFramework/BenchControl/Danfoss/VLT2800/Pump.cs @@ -110,6 +110,7 @@ namespace TBF.BenchControl.Danfoss.VLT2800 bitPosition = pumpCfg.BitPosition; Mask = (((ulong)1) << bitPosition); + Mask |= (((ulong)1) << (bitPosition + 1)); log.Debug(this.ToString()); } diff --git a/TestBenchFramework/BenchControl/Danfoss/VLT2800/PumpCfg.cs b/TestBenchFramework/BenchControl/Danfoss/VLT2800/PumpCfg.cs index aa749e46c..1db7d3f8b 100644 --- a/TestBenchFramework/BenchControl/Danfoss/VLT2800/PumpCfg.cs +++ b/TestBenchFramework/BenchControl/Danfoss/VLT2800/PumpCfg.cs @@ -15,9 +15,9 @@ namespace TBF.BenchControl.Danfoss.VLT2800 /// Serialized parameters /// public int Delay; // Delay of the pump function in [s] (affects the duration of transition sequence steps) - public PumpProtocol Protocol; // Modbus or FC + public PumpProtocol Protocol; // Modbus or FC with Siemens address public int BitPosition; - public int BusAddress; // Modbus or FC address in range 1..247 (Modbus) or 1..31 (FC) + public int BusAddress; // Modbus or FC address in range 1..247 (Modbus) or 1..31 (FC with Siemens address) public int ComPortNr; public int BaudRate; public Parity Parity; @@ -28,14 +28,16 @@ namespace TBF.BenchControl.Danfoss.VLT2800 PumpCfg() { Name = "Pump-Danfoss"; + ParentName = string.Empty; Delay = 1; - Protocol = PumpProtocol.Modbus; + ComPortNr = 3; + + /// Default protocol settings (the same as Danfoss VLT2800 factory settings) + Protocol = PumpProtocol.FC; BusAddress = 1; - ParentName = string.Empty; - ComPortNr = 5; BaudRate = 9600; DataBits = 8; - Parity = System.IO.Ports.Parity.None; + Parity = System.IO.Ports.Parity.Even; /// 'Parity.None' is the default value for Protocol = PumpProtocol.Modbus StopBits = System.IO.Ports.StopBits.One; } diff --git a/TestBenchFramework/BenchControl/Events.cs b/TestBenchFramework/BenchControl/Events.cs index 074a7c4df..d0d03490a 100644 --- a/TestBenchFramework/BenchControl/Events.cs +++ b/TestBenchFramework/BenchControl/Events.cs @@ -37,17 +37,17 @@ public enum ValveCategory { - All = 0, /// Valve will be shown in all paths - Feeding, /// Valve will be shown in Feeding paths - Bench, /// Valve will be shown in Bench paths - Output, /// Valve will be shown in Output paths - None, /// Valve will not be shown in the paths + All = 0, /// Valve will be shown in all paths + Feeding, /// Valve will be shown in Feeding paths + Bench, /// Valve will be shown in Bench paths + Output, /// Valve will be shown in Output paths + None, /// Valve will not be shown in the paths } public enum PumpProtocol { - Modbus, - FC, + Modbus, /// Modbus protocol, default serial settings are 9600Bd, 8bits, NoP, 1stop + FC, /// FC protocol with Siemens address (1..31), default serial settings are 9600Bd, 8bits, PE, 1stop } /// diff --git a/TestBenchFramework/BenchControl/Sequences/SequenceBase.cs b/TestBenchFramework/BenchControl/Sequences/SequenceBase.cs index 0e74056ac..827d98aec 100644 --- a/TestBenchFramework/BenchControl/Sequences/SequenceBase.cs +++ b/TestBenchFramework/BenchControl/Sequences/SequenceBase.cs @@ -740,7 +740,7 @@ namespace TBF.BenchControl.Sequences sb.Append(";"); sb.Append("0"); sb.Append(";"); sb.Append("2"); sb.Append(";"); sb.Append(" "); - sb.Append(";"); sb.Append(outPath.Balance.Cfg.Name); + sb.Append(";"); if (outPath.Balance != null) sb.Append(outPath.Balance.Name); sb.Append(";"); sb.Append(tstRslt.AmbientTempAve); sb.Append(";"); sb.Append(tstRslt.AmbientPressAve); sb.Append(";"); sb.Append(tstRslt.AmbientHumiAve); @@ -780,8 +780,10 @@ namespace TBF.BenchControl.Sequences sb.Append(";"); sb.Append(tstRslt.Time); /// t sb.Append(";"); sb.Append(tstRslt.ErrorMaster); /// Eelm . . . chyba etalonu voci komercne pravej hodnote sb.Append(";"); sb.Append(" "); /// Emass . . . chyba druheho etalonu voci komercne pravej hodnote (teraz vynechavame) - sb.Append(";"); sb.Append(1.0f / outPath.FlowMeter.LtrPerPulse); - /// Const.MID . konstanta eatlonu + sb.Append(";"); if (outPath.FlowMeter != null && outPath.FlowMeter.LtrPerPulse != 0) + { + sb.Append(1.0f / outPath.FlowMeter.LtrPerPulse);/// Const.MID . konstanta eatlonu + } sb.Append(";"); sb.Append(" "); /// Const.MA . . konstanta druheho etalonu sb.Append(";"); sb.Append(tstRslt.TimeDivStart0); /// Time Div Start celkovy cas v [ms] sb.Append(";"); sb.Append(tstRslt.TimeDivStart1); /// Time Div Start1 diff --git a/TestBenchFramework/BenchControl/TestMethods/LeakTest/LeakTestParams.cs b/TestBenchFramework/BenchControl/TestMethods/LeakTest/LeakTestParams.cs index 5ffb1f186..a211acfaf 100644 --- a/TestBenchFramework/BenchControl/TestMethods/LeakTest/LeakTestParams.cs +++ b/TestBenchFramework/BenchControl/TestMethods/LeakTest/LeakTestParams.cs @@ -9,15 +9,17 @@ namespace TBF.BenchControl.TestMethods.LeakTest { public class LeakTestParams : TestParamsBase, IParamsProvider, ITestParams { - public float PressureLo; /// Presure range low limit in bar - public float PressureHi; /// Presure range high limit in bar - public int Duration; /// Duration of the test in [s] + public float PressureLo; /// Presure range low limit in kPa + public float PressureHi; /// Presure range high limit in kPa + public int DurationPMax; /// Duration of PMax test in [s] + public int DurationLeak; /// Duration of Leak test in [s] public override void InitializeAll() { - PressureLo = 1.0f; - PressureHi = 2.0f; - Duration = 10; + PressureLo = 500.0f; /// kPa + PressureHi = 600.0f; /// kPa + DurationPMax = 10; + DurationLeak = 60; } @@ -25,7 +27,8 @@ namespace TBF.BenchControl.TestMethods.LeakTest { Strings.PressureLo_bar, Strings.PressureHi_bar, - Strings.Duration_s, + Strings.Duration_PMax_s, + Strings.Duration_Leak_s, }; public override string ParamName(int i) { return paramNames[i]; } public override int ParamsCount() { return paramNames.Length; } @@ -34,9 +37,10 @@ namespace TBF.BenchControl.TestMethods.LeakTest { switch (i) { - case 0: return PressureLo.ToString(); - case 1: return PressureHi.ToString(); - case 2: return Duration.ToString(); + case 0: return (PressureLo / 100.0f).ToString(); /// Saved in kPa, UI in bar + case 1: return (PressureHi / 100.0f).ToString(); /// Saved in kPa, UI in bar + case 2: return DurationPMax.ToString(); + case 3: return DurationLeak.ToString(); default: return string.Empty; } } @@ -45,9 +49,10 @@ namespace TBF.BenchControl.TestMethods.LeakTest { switch (i) { - case 0: PressureLo = Utils.ParseUFloat(strValue); return; - case 1: PressureHi = Utils.ParseSFloat(strValue); return; - case 2: Duration = int.Parse(strValue); return; + case 0: PressureLo = 100.0f * Utils.ParseUFloat(strValue); return; /// Saved in kPa, UI in bar + case 1: PressureHi = 100.0f * Utils.ParseSFloat(strValue); return; /// Saved in kPa, UI in bar + case 2: DurationPMax = int.Parse(strValue); return; + case 3: DurationLeak = int.Parse(strValue); return; default: return; } } @@ -65,6 +70,7 @@ namespace TBF.BenchControl.TestMethods.LeakTest if (Utils.TryParseUFloat(strValue, out dummy)) return true; break; case 2: + case 3: if (int.TryParse(strValue, out iDummy)) return true; break; default: @@ -90,7 +96,8 @@ namespace TBF.BenchControl.TestMethods.LeakTest PressureLo = tmp.PressureLo; PressureHi = tmp.PressureHi; - Duration = tmp.Duration; + DurationPMax = tmp.DurationPMax; + DurationLeak = tmp.DurationLeak; } catch { diff --git a/TestBenchFramework/BenchControl/TestMethods/LeakTest/LeakTestSeq.cs b/TestBenchFramework/BenchControl/TestMethods/LeakTest/LeakTestSeq.cs index 320b4c91a..824c476eb 100644 --- a/TestBenchFramework/BenchControl/TestMethods/LeakTest/LeakTestSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/LeakTest/LeakTestSeq.cs @@ -27,67 +27,52 @@ namespace TBF.BenchControl.TestMethods.LeakTest { Elde.ControlBoardDev cBrd = StateMachine.ControlBoard; - IList e = new List(); /// Events from currently running operations - Event retVal = Event.Done; - checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state + IList e = new List(); /// Events from currently running operations + Event retVal = Event.Done; + checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state - ltrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h] + processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this); - /// Notes: - /// float timeHr = volumeLtr / (1000.0f * targetFlow); - /// float timeSec = 3600.0f * timeHr; - /// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow)); - int totalPulses = (int)(test.Volume / ltrPerRefPulse + 0.5f); - processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this); - - int repetitionNr = 1; /// First test: repetitionNr=1 - - //==================================== // Transition or SetRoute - Start - //==================================== switch (Transition(transitionStart, TransitionContext.TestStart)) { - case Event.Error: { retVal = Event.Error; goto stopTest; } - case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; } + case Event.Error: { retVal = Event.Error; goto stopTest; } + case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; } } /// Start the test, initialize test results - Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, totalPulses)); - Entities.TestResult tstRslt = new Entities.TestResult(test, repetitionNr, Entities.MetersKind.Single); - - //------------------------------------------------ - Bridge.OnActivity(this, Strings.Starting_the_pump); - //------------------------------------------------ - int flowSetTime0 = StateMachine.Time; - float estFlowSetTime = 10.0f; + Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, 1, inPath, benchPath, outPath, sensPath, 0)); + Entities.TestResult tstRslt = new Entities.TestResult(test, 1, Entities.MetersKind.Single); + //------------------------------------------------ + Bridge.OnActivity(this, Strings.Starting_the_pump); + //------------------------------------------------ if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOn(test.PumpPower); State.Create("LeakTest : Starting the pump") - .AddOperation(checkUiOp) + .AddOperation(checkUiOp) .AddOperation(cBrd.SetValvesOp(inPath.Pump, null)) .AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn)) .AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut)) - .AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv)) .AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn)) .AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut)) - .EnterState(); - do - { - e = StateMachine.WaitRunDevsRunOps(); + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; } - } - while (e.Contains(Event.ValvesBusy)); + } + while (e.Contains(Event.ValvesBusy)); //------------------------------------------------ Bridge.OnActivity(this, Strings.Setting_the_water_pressure); //------------------------------------------------ - const float pumpPowerStep = 3.0f; float pumpPower = test.PumpPower; int startTime = StateMachine.Time; - do + + while (true) { if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOn(pumpPower); @@ -95,7 +80,6 @@ namespace TBF.BenchControl.TestMethods.LeakTest .AddOperation(checkUiOp) .AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn)) .AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut)) - .AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv)) .AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn)) .AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut)) .AddOperation(new Operations.TimerOp(5)) @@ -109,57 +93,146 @@ namespace TBF.BenchControl.TestMethods.LeakTest } while (e.Contains(Event.TimerBusy)); - UiBridge.Bridge.OnLog(this, string.Format("time = {0}, pump_power = {1}%, pressure_up = {2}, pressure_down = {3}\r\n", + UiBridge.Bridge.OnLog(this, string.Format("time = {0}, pump_power = {1}%, pressure_up = {2}kPa, pressure_down = {3}kPa\r\n", StateMachine.Time - startTime, pumpPower.ToString("F0"), - pressIn.Val.ToString("F3"), - pressIn.Val.ToString("F3"))); + pressIn.Val.ToString("F1"), + pressIn.Val.ToString("F1"))); - if (pumpPower == 100.0f) break; /// Already at the max.pump power + float step = (pumpPower < 40.0f) ? 5.0f : ((pumpPower < 60.0f) ? 3.0f : ((pumpPower < 80.0f) ? 2.0f : 1.0f)); - pumpPower += pumpPowerStep; - if (pumpPower >= 100.0f) pumpPower = 100.0f; /// Max. 100% + if (pressOut.Val < testParams.PressureLo) + { + if (pumpPower == 100.0f) break; /// Already at max. pump power -> Quit loop + pumpPower = Math.Min(pumpPower + step, 100.0f); /// Limit max. power to 100% + } + else if (pressOut.Val > testParams.PressureHi) + { + if (pumpPower == 0) break; /// Already at min. pump power -> Quit loop + pumpPower = Math.Max(pumpPower - step, 0); /// Limit min. power to 0% + } + else + { + break; /// Pressure is in the range -> Quit loop + } } - while (testParams.PressureLo <= pressOut.Val && pressOut.Val <= testParams.PressureHi); - pressure_set: + pressure_set: - int time = StateMachine.Time; - tstRslt.TimeStart = DateTime.Now; - ResetAveragedData(); - bool firstTime = true; + startTime = StateMachine.Time; + int estimtdEndTime = startTime + testParams.DurationPMax; - //------------------------------------------------ - Bridge.OnActivity(this, Strings.Test_in_progress); - //------------------------------------------------ - State.Create("LeakTest : Starting the test") + //------------------------------------------------ + Bridge.OnActivity(this, Strings.Test_in_progress); + //------------------------------------------------ + State.Create("LeakTest : Maximum water pressure set") .AddOperation(checkUiOp) .AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn)) .AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut)) - .AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv)) .AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn)) .AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut)) - .AddOperation(new Operations.TimerOp(testParams.Duration)) + .AddOperation(new Operations.TimerOp(testParams.DurationPMax)) .EnterState(); do { e = StateMachine.WaitRunDevsRunOps(); - if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; } + + tstRslt.TempInStart = tempIn.Val; + tstRslt.TempOutStart = tempOut.Val; + tstRslt.PressInStart = pressIn.Val; + tstRslt.PressOutStart = pressOut.Val; + + if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; } if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; } - if (firstTime) - { - firstTime = false; /// Do the following only once - tstRslt.TempInStart = tempIn.Val; - tstRslt.TempOutStart = tempOut.Val; - tstRslt.TempDivStart = tempDiv.Val; - tstRslt.PressInStart = pressIn.Val; - tstRslt.PressOutStart = pressOut.Val; - } + int remainingTime = Math.Max(estimtdEndTime - StateMachine.Time, 0); + Bridge.OnActivity(this, string.Format("{0} ... {1} s", Strings.Test_in_progress, remainingTime)); + } + while (e.Contains(Event.TimerBusy)); + + closing_valve: + + //------------------------------------------------ + Bridge.OnActivity(this, Strings.Closing_valve_Pump_off); + //------------------------------------------------ + State.Create("LeakTest : Closing the valve") + .AddOperation(checkUiOp) + .AddOperation(cBrd.SetValvesOp(null, outPath.StartValve)) + .AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn)) + .AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut)) + .AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn)) + .AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + + tstRslt.TempInStart = tempIn.Val; + tstRslt.TempOutStart = tempOut.Val; + tstRslt.PressInStart = pressIn.Val; + tstRslt.PressOutStart = pressOut.Val; + + if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; } + if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; } + } + while (e.Contains(Event.ValvesBusy)); + + valve_closed: + + if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOff(); + + State.Create("LeakTest : Closing the valve") + .AddOperation(checkUiOp) + .AddOperation(cBrd.SetValvesOp(null, inPath.Pump)) + .AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn)) + .AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut)) + .AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn)) + .AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + + tstRslt.TempInStart = tempIn.Val; + tstRslt.TempOutStart = tempOut.Val; + tstRslt.PressInStart = pressIn.Val; + tstRslt.PressOutStart = pressOut.Val; + + if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; } + if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; } + } + while (e.Contains(Event.ValvesBusy)); + + + pump_is_off: + + tstRslt.TimeStart = DateTime.Now; + startTime = StateMachine.Time; + estimtdEndTime = startTime + testParams.DurationLeak; + ResetAveragedData(); + + //------------------------------------------------ + Bridge.OnActivity(this, Strings.Test_in_progress); + //------------------------------------------------ + State.Create("LeakTest : Starting the test") + .AddOperation(checkUiOp) + .AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn)) + .AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut)) + .AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn)) + .AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut)) + .AddOperation(new Operations.TimerOp(testParams.DurationLeak)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; } + if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; } + + int remainingTime = Math.Max(estimtdEndTime - StateMachine.Time, 0); + Bridge.OnActivity(this, string.Format("{0} ... {1} s", Strings.Test_in_progress, remainingTime)); tstRslt.TempInEnd = tempIn.Val; tstRslt.TempOutEnd = tempOut.Val; - tstRslt.TempDivEnd = tempDiv.Val; tstRslt.PressInEnd = pressIn.Val; tstRslt.PressOutEnd = pressOut.Val; tstRslt.MassEndRaw = mass.Val; @@ -168,9 +241,9 @@ namespace TBF.BenchControl.TestMethods.LeakTest } while (e.Contains(Event.TimerBusy)); - /// Measurement loop - end + /// Measurement loop - end - test_completed: + test_completed: //------------------------------------------------ Bridge.OnActivity(this, Strings.Test_completed); @@ -188,49 +261,49 @@ namespace TBF.BenchControl.TestMethods.LeakTest /// UpdateTestRsltWithAveragedData(tstRslt); - tstRslt.TimeEnd = DateTime.Now; - tstRslt.BatchNr = Program.LocalSettings.BatchNr; - tstRslt.MassStart = 0; - tstRslt.MassEnd = 0; - tstRslt.MassDiff = 0; - tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempInAvrg); /// [kg/m3] - tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg); /// [kg/m3] - tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivAvrg); /// [kg/m3] - tstRslt.Time = testParams.Duration; /// [s] measurement time - tstRslt.FlowMass = 0; /// [kg/h] - tstRslt.FlowVolume = 0; /// [l/h] - tstRslt.PulsesMaster = 0; /// Pulses of the master flow meter (test total) - tstRslt.VolumeMaster = 0; /// [l] volume from the master flow meter - tstRslt.ConstMaster = 0; /// Convert the flow to [m3/h] - tstRslt.VolumeCTV = 0; /// [l] 1000.0f is because density is in [kg/m3] - tstRslt.ErrorMaster = 0; - tstRslt.TimeDivStart0 = 0; - tstRslt.TimeDivStart1 = 0; - tstRslt.TimeDivStart2 = 0; - tstRslt.TimeDivStart3 = 0; - tstRslt.TimeDivStart4 = 0; - tstRslt.TimeDivStart5 = 0; - tstRslt.TimeDivEnd0 = 0; - tstRslt.TimeDivEnd1 = 0; - tstRslt.TimeDivEnd2 = 0; - tstRslt.TimeDivEnd3 = 0; - tstRslt.TimeDivEnd4 = 0; - tstRslt.TimeDivEnd5 = 0; + tstRslt.TimeEnd = DateTime.Now; + tstRslt.BatchNr = Program.LocalSettings.BatchNr; + tstRslt.MassStart = 0; + tstRslt.MassEnd = 0; + tstRslt.MassDiff = 0; + tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempInAvrg); /// [kg/m3] + tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg);/// [kg/m3] + tstRslt.DensityDiv = 0; /// [kg/m3] + tstRslt.Time = testParams.DurationPMax; /// [s] measurement time + tstRslt.FlowMass = 0; /// [kg/h] + tstRslt.FlowVolume = 0; /// [l/h] + tstRslt.PulsesMaster = 0; /// Pulses of the master flow meter (test total) + tstRslt.VolumeMaster = 0; /// [l] volume from the master flow meter + tstRslt.ConstMaster = 0; /// Convert the flow to [m3/h] + tstRslt.VolumeCTV = 0; /// [l] 1000.0f is because density is in [kg/m3] + tstRslt.ErrorMaster = 0; + tstRslt.TimeDivStart0 = 0; + tstRslt.TimeDivStart1 = 0; + tstRslt.TimeDivStart2 = 0; + tstRslt.TimeDivStart3 = 0; + tstRslt.TimeDivStart4 = 0; + tstRslt.TimeDivStart5 = 0; + tstRslt.TimeDivEnd0 = 0; + tstRslt.TimeDivEnd1 = 0; + tstRslt.TimeDivEnd2 = 0; + tstRslt.TimeDivEnd3 = 0; + tstRslt.TimeDivEnd4 = 0; + tstRslt.TimeDivEnd5 = 0; for (int i = 0; i < Program.WMsCount; i++) { if (sensPath.RegisterReaders[i] != null) { - tstRslt.Meters[i].SerialNr = (WaterMeters.Count > i) ? WaterMeters[i].SerialNr : string.Empty; - tstRslt.Meters[i].VolumeStart = 0; - tstRslt.Meters[i].VolumeEnd = 0; - tstRslt.Meters[i].VolumeMeter = 0; - tstRslt.Meters[i].VolumeRef = 0; - tstRslt.Meters[i].PulsesMeter = 0; - tstRslt.Meters[i].PulsesMaster = 0; - tstRslt.Meters[i].Time = testParams.Duration; - tstRslt.Meters[i].VolumeErrorPct= 0; - tstRslt.Meters[i].Passed = true; + tstRslt.Meters[i].SerialNr = (WaterMeters.Count > i) ? WaterMeters[i].SerialNr : string.Empty; + tstRslt.Meters[i].VolumeStart = 0; + tstRslt.Meters[i].VolumeEnd = 0; + tstRslt.Meters[i].VolumeMeter = 0; + tstRslt.Meters[i].VolumeRef = 0; + tstRslt.Meters[i].PulsesMeter = 0; + tstRslt.Meters[i].PulsesMaster = 0; + tstRslt.Meters[i].Time = testParams.DurationPMax; + tstRslt.Meters[i].VolumeErrorPct = 0; + tstRslt.Meters[i].Passed = true; } } /// Add data - end @@ -245,10 +318,9 @@ namespace TBF.BenchControl.TestMethods.LeakTest stopTest: - ///----------------------/// - /// Quit this sequence /// - ///----------------------/// - + /// + /// Quit this sequence + /// State.Create("LeakTest : Stopping diverter, gate, etc.") .AddOperation(checkUiOp) .AddOperation(cBrd.StopPreviousOp()) @@ -264,7 +336,7 @@ namespace TBF.BenchControl.TestMethods.LeakTest /// Prevent overwriting 'retVal' in case it was set to non-default value earlier switch (Transition(transitionStop, TransitionContext.TestEnd)) { - case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; } + case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; } case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; } } diff --git a/TestBenchFramework/BenchControl/TestMethods/PMaxTest/PMaxTestParams.cs b/TestBenchFramework/BenchControl/TestMethods/PMaxTest/PMaxTestParams.cs index c55b83658..96ed05d7b 100644 --- a/TestBenchFramework/BenchControl/TestMethods/PMaxTest/PMaxTestParams.cs +++ b/TestBenchFramework/BenchControl/TestMethods/PMaxTest/PMaxTestParams.cs @@ -9,15 +9,15 @@ namespace TBF.BenchControl.TestMethods.PMaxTest { public class PMaxTestParams : TestParamsBase, IParamsProvider, ITestParams { - public float PressureLo; /// Presure range low limit in bar - public float PressureHi; /// Presure range high limit in bar - public int Duration; /// Duration of the test in [s] + public float PressureLo; /// Presure range low limit in kPa + public float PressureHi; /// Presure range high limit in kPa + public int DurationPMax; /// Duration of the test in [s] public override void InitializeAll() { - PressureLo = 1.0f; - PressureHi = 2.0f; - Duration = 10; + PressureLo = 500.0f; /// kPa + PressureHi = 600.0f; /// kPa + DurationPMax = 60; } @@ -34,9 +34,9 @@ namespace TBF.BenchControl.TestMethods.PMaxTest { switch (i) { - case 0: return PressureLo.ToString(); - case 1: return PressureHi.ToString(); - case 2: return Duration.ToString(); + case 0: return (PressureLo / 100.0f).ToString(); /// Saved in kPa, UI in bar + case 1: return (PressureHi / 100.0f).ToString(); /// Saved in kPa, UI in bar + case 2: return DurationPMax.ToString(); default: return string.Empty; } } @@ -45,9 +45,9 @@ namespace TBF.BenchControl.TestMethods.PMaxTest { switch (i) { - case 0: PressureLo = Utils.ParseUFloat(strValue); return; - case 1: PressureHi = Utils.ParseSFloat(strValue); return; - case 2: Duration = int.Parse(strValue); return; + case 0: PressureLo = 100.0f * Utils.ParseUFloat(strValue); return; /// Saved in kPa, UI in bar + case 1: PressureHi = 100.0f * Utils.ParseSFloat(strValue); return; /// Saved in kPa, UI in bar + case 2: DurationPMax = int.Parse(strValue); return; default: return; } } @@ -90,7 +90,7 @@ namespace TBF.BenchControl.TestMethods.PMaxTest PressureLo = tmp.PressureLo; PressureHi = tmp.PressureHi; - Duration = tmp.Duration; + DurationPMax = tmp.DurationPMax; } catch { diff --git a/TestBenchFramework/BenchControl/TestMethods/PMaxTest/PMaxTestSeq.cs b/TestBenchFramework/BenchControl/TestMethods/PMaxTest/PMaxTestSeq.cs index 0b2f3dc75..310e13406 100644 --- a/TestBenchFramework/BenchControl/TestMethods/PMaxTest/PMaxTestSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/PMaxTest/PMaxTestSeq.cs @@ -31,21 +31,10 @@ namespace TBF.BenchControl.TestMethods.PMaxTest Event retVal = Event.Done; checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state - ltrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h] - - /// Notes: - /// float timeHr = volumeLtr / (1000.0f * targetFlow); - /// float timeSec = 3600.0f * timeHr; - /// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow)); - int totalPulses = (int)(test.Volume / ltrPerRefPulse + 0.5f); - processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this); - int repetitionNr = 1; /// First test: repetitionNr=1 - //==================================== // Transition or SetRoute - Start - //==================================== switch (Transition(transitionStart, TransitionContext.TestStart)) { case Event.Error: { retVal = Event.Error; goto stopTest; } @@ -53,15 +42,12 @@ namespace TBF.BenchControl.TestMethods.PMaxTest } /// Start the test, initialize test results - Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, totalPulses)); - Entities.TestResult tstRslt = new Entities.TestResult(test, repetitionNr, Entities.MetersKind.Single); + Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, 1, inPath, benchPath, outPath, sensPath, 0)); + Entities.TestResult tstRslt = new Entities.TestResult(test, 1, Entities.MetersKind.Single); //------------------------------------------------ Bridge.OnActivity(this, Strings.Starting_the_pump); //------------------------------------------------ - int flowSetTime0 = StateMachine.Time; - float estFlowSetTime = 10.0f; - if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOn(test.PumpPower); State.Create("PMaxTest : Starting the pump") @@ -69,7 +55,6 @@ namespace TBF.BenchControl.TestMethods.PMaxTest .AddOperation(cBrd.SetValvesOp(inPath.Pump, null)) .AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn)) .AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut)) - .AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv)) .AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn)) .AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut)) .EnterState(); @@ -84,18 +69,17 @@ namespace TBF.BenchControl.TestMethods.PMaxTest Bridge.OnActivity(this, Strings.Setting_the_water_pressure); //------------------------------------------------ - const float pumpPowerStep = 3.0f; float pumpPower = test.PumpPower; int startTime = StateMachine.Time; - do - { + + while (true) + { if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOn(pumpPower); State.Create("PMaxTest : Setting the water pressure") .AddOperation(checkUiOp) .AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn)) .AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut)) - .AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv)) .AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn)) .AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut)) .AddOperation(new Operations.TimerOp(5)) @@ -109,25 +93,41 @@ namespace TBF.BenchControl.TestMethods.PMaxTest } while (e.Contains(Event.TimerBusy)); - UiBridge.Bridge.OnLog(this, string.Format("time = {0}, pump_power = {1}%, pressure_up = {2}, pressure_down = {3}\r\n", + UiBridge.Bridge.OnLog(this, string.Format("time = {0}, pump_power = {1}%, pressure_up = {2}kPa, pressure_down = {3}kPa\r\n", StateMachine.Time - startTime, pumpPower.ToString("F0"), - pressIn.Val.ToString("F3"), - pressIn.Val.ToString("F3"))); + pressIn.Val.ToString("F1"), + pressIn.Val.ToString("F1"))); - if (pumpPower == 100.0f) break; /// Already at the max.pump power + tstRslt.TempInStart = tempIn.Val; + tstRslt.TempOutStart = tempOut.Val; + tstRslt.PressInStart = pressIn.Val; + tstRslt.PressOutStart = pressOut.Val; - pumpPower += pumpPowerStep; - if (pumpPower >= 100.0f) pumpPower = 100.0f; /// Max. 100% + float step = (pumpPower < 40.0f) ? 5.0f : ((pumpPower < 60.0f) ? 3.0f : ((pumpPower < 80.0f) ? 2.0f : 1.0f)); + + if (pressOut.Val < testParams.PressureLo) + { + if (pumpPower == 100.0f) break; /// Already at max. pump power -> Quit loop + pumpPower = Math.Min(pumpPower + step, 100.0f); /// Limit max. power to 100% + } + else if (pressOut.Val > testParams.PressureHi) + { + if (pumpPower == 0) break; /// Already at min. pump power -> Quit loop + pumpPower = Math.Max(pumpPower - step, 0); /// Limit min. power to 0% + } + else + { + break; /// Pressure is in the range -> Quit loop + } } - while (testParams.PressureLo <= pressOut.Val && pressOut.Val <= testParams.PressureHi); pressure_set: - int time = StateMachine.Time; - tstRslt.TimeStart = DateTime.Now; + tstRslt.TimeStart = DateTime.Now; + startTime = StateMachine.Time; + int endTime = startTime + testParams.DurationPMax; ResetAveragedData(); - bool firstTime = true; //------------------------------------------------ Bridge.OnActivity(this, Strings.Test_in_progress); @@ -136,10 +136,9 @@ namespace TBF.BenchControl.TestMethods.PMaxTest .AddOperation(checkUiOp) .AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn)) .AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut)) - .AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv)) .AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn)) .AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut)) - .AddOperation(new Operations.TimerOp(testParams.Duration)) + .AddOperation(new Operations.TimerOp(testParams.DurationPMax)) .EnterState(); do { @@ -147,19 +146,11 @@ namespace TBF.BenchControl.TestMethods.PMaxTest if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; } if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; } - if (firstTime) - { - firstTime = false; /// Do the following only once - tstRslt.TempInStart = tempIn.Val; - tstRslt.TempOutStart = tempOut.Val; - tstRslt.TempDivStart = tempDiv.Val; - tstRslt.PressInStart = pressIn.Val; - tstRslt.PressOutStart = pressOut.Val; - } + int remainingTime = Math.Max(endTime - StateMachine.Time, 0); + Bridge.OnActivity(this, string.Format("{0} ... {1} s", Strings.Test_in_progress, remainingTime)); tstRslt.TempInEnd = tempIn.Val; tstRslt.TempOutEnd = tempOut.Val; - tstRslt.TempDivEnd = tempDiv.Val; tstRslt.PressInEnd = pressIn.Val; tstRslt.PressOutEnd = pressOut.Val; tstRslt.MassEndRaw = mass.Val; @@ -195,8 +186,8 @@ namespace TBF.BenchControl.TestMethods.PMaxTest tstRslt.MassDiff = 0; tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempInAvrg); /// [kg/m3] tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg); /// [kg/m3] - tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivAvrg); /// [kg/m3] - tstRslt.Time = testParams.Duration; /// [s] measurement time + tstRslt.DensityDiv = 0; /// [kg/m3] + tstRslt.Time = testParams.DurationPMax; /// [s] measurement time tstRslt.FlowMass = 0; /// [kg/h] tstRslt.FlowVolume = 0; /// [l/h] tstRslt.PulsesMaster = 0; /// Pulses of the master flow meter (test total) @@ -228,7 +219,7 @@ namespace TBF.BenchControl.TestMethods.PMaxTest tstRslt.Meters[i].VolumeRef = 0; tstRslt.Meters[i].PulsesMeter = 0; tstRslt.Meters[i].PulsesMaster = 0; - tstRslt.Meters[i].Time = testParams.Duration; + tstRslt.Meters[i].Time = testParams.DurationPMax; tstRslt.Meters[i].VolumeErrorPct= 0; tstRslt.Meters[i].Passed = true; } @@ -245,10 +236,9 @@ namespace TBF.BenchControl.TestMethods.PMaxTest stopTest: - ///----------------------/// - /// Quit this sequence /// - ///----------------------/// - + /// + /// Quit this sequence + /// State.Create("PMaxTest : Stopping diverter, gate, etc.") .AddOperation(checkUiOp) .AddOperation(cBrd.StopPreviousOp()) diff --git a/TestBenchFramework/Forms/ResultItemSpec.cs b/TestBenchFramework/Forms/ResultItemSpec.cs index 3d27b6065..38661bfed 100644 --- a/TestBenchFramework/Forms/ResultItemSpec.cs +++ b/TestBenchFramework/Forms/ResultItemSpec.cs @@ -106,10 +106,18 @@ namespace TBF.Forms (x, y, z) => z.TestResult.TempOutAvrg.ToString("F2"))); AllItems.Add(new ResultItemSpec("T div", Strings.T_div, x => x.TestResult.TempDivAvrg.ToString("F2"), (x, y, z) => z.TestResult.TempDivAvrg.ToString("F2"))); - AllItems.Add(new ResultItemSpec("P in", Strings.P_in, x => x.TestResult.PressInAvrg.ToString("F3"), + AllItems.Add(new ResultItemSpec("P up", Strings.P_in, x => x.TestResult.PressInAvrg.ToString("F3"), (x, y, z) => z.TestResult.PressInAvrg.ToString("F3"))); - AllItems.Add(new ResultItemSpec("P out", Strings.P_out, x => x.TestResult.PressOutAvrg.ToString("F3"), + AllItems.Add(new ResultItemSpec("P up start", Strings.P_in_start, x => x.TestResult.PressInStart.ToString("F3"), + (x, y, z) => z.TestResult.PressInStart.ToString("F3"))); + AllItems.Add(new ResultItemSpec("P up end", Strings.P_in_end, x => x.TestResult.PressInEnd.ToString("F3"), + (x, y, z) => z.TestResult.PressInEnd.ToString("F3"))); + AllItems.Add(new ResultItemSpec("P down", Strings.P_out, x => x.TestResult.PressOutAvrg.ToString("F3"), (x, y, z) => z.TestResult.PressOutAvrg.ToString("F3"))); + AllItems.Add(new ResultItemSpec("P down start", Strings.P_out_start, x => x.TestResult.PressOutStart.ToString("F3"), + (x, y, z) => z.TestResult.PressOutStart.ToString("F3"))); + AllItems.Add(new ResultItemSpec("P down end", Strings.P_out_end, x => x.TestResult.PressOutEnd.ToString("F3"), + (x, y, z) => z.TestResult.PressOutEnd.ToString("F3"))); AllItems.Add(new ResultItemSpec("Reference error", "Err.ref. [%]", x => x.TestResult.ErrorMaster.ToString("F3"), (x, y, z) => z.TestResult.ErrorMaster.ToString("F3"))); AllItems.Add(new ResultItemSpec("Ambient temperature", "T amb", x => x.TestResult.AmbientTempAve.ToString("F1"), diff --git a/TestBenchFramework/Resources/Strings.Designer.cs b/TestBenchFramework/Resources/Strings.Designer.cs index 8ca9e8f16..578cd1a60 100644 --- a/TestBenchFramework/Resources/Strings.Designer.cs +++ b/TestBenchFramework/Resources/Strings.Designer.cs @@ -321,6 +321,15 @@ namespace TBF.Resources { } } + /// + /// Looks up a localized string similar to Closing input valve, switching the pump off. + /// + internal static string Closing_valve_Pump_off { + get { + return ResourceManager.GetString("Closing_valve_Pump_off", resourceCulture); + } + } + /// /// Looks up a localized string similar to Combined meters. /// @@ -573,6 +582,24 @@ namespace TBF.Resources { } } + /// + /// Looks up a localized string similar to Leak duration [s]. + /// + internal static string Duration_Leak_s { + get { + return ResourceManager.GetString("Duration_Leak_s", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to PMax duration [s]. + /// + internal static string Duration_PMax_s { + get { + return ResourceManager.GetString("Duration_PMax_s", resourceCulture); + } + } + /// /// Looks up a localized string similar to Duration [s]. /// @@ -1267,7 +1294,7 @@ namespace TBF.Resources { } /// - /// Looks up a localized string similar to P in. + /// Looks up a localized string similar to P up. /// internal static string P_in { get { @@ -1276,7 +1303,25 @@ namespace TBF.Resources { } /// - /// Looks up a localized string similar to P out. + /// Looks up a localized string similar to P up end. + /// + internal static string P_in_end { + get { + return ResourceManager.GetString("P_in_end", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to P up start. + /// + internal static string P_in_start { + get { + return ResourceManager.GetString("P_in_start", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to P down. /// internal static string P_out { get { @@ -1284,6 +1329,24 @@ namespace TBF.Resources { } } + /// + /// Looks up a localized string similar to P down end. + /// + internal static string P_out_end { + get { + return ResourceManager.GetString("P_out_end", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to P down start. + /// + internal static string P_out_start { + get { + return ResourceManager.GetString("P_out_start", resourceCulture); + } + } + /// /// Looks up a localized string similar to Parameters. /// diff --git a/TestBenchFramework/Resources/Strings.de.resx b/TestBenchFramework/Resources/Strings.de.resx index c0d3cbe67..3deba9424 100644 --- a/TestBenchFramework/Resources/Strings.de.resx +++ b/TestBenchFramework/Resources/Strings.de.resx @@ -939,4 +939,16 @@ WZ_Stand + + P ein. ende + + + P ein. start + + + P aus. ende + + + P aus. start + \ No newline at end of file diff --git a/TestBenchFramework/Resources/Strings.resx b/TestBenchFramework/Resources/Strings.resx index 25f6aabb9..c74b6fa1b 100644 --- a/TestBenchFramework/Resources/Strings.resx +++ b/TestBenchFramework/Resources/Strings.resx @@ -181,10 +181,10 @@ Pump - P in + P up - P out + P down Q from [m3/h] @@ -973,4 +973,25 @@ Pressure Selection + + Leak duration [s] + + + PMax duration [s] + + + P up end + + + P up start + + + P down end + + + P down start + + + Closing input valve, switching the pump off + \ No newline at end of file diff --git a/TestBenchFramework/Screens/ProcessTabPageCtrl.cs b/TestBenchFramework/Screens/ProcessTabPageCtrl.cs index 513f6fb03..bd7d54e8f 100644 --- a/TestBenchFramework/Screens/ProcessTabPageCtrl.cs +++ b/TestBenchFramework/Screens/ProcessTabPageCtrl.cs @@ -306,14 +306,14 @@ namespace TBF.Screens estmtdTimeLabel.Text = args.Test.TstTime.ToString("F1"); /// Names of virtual bench components - prInCmpntLabel.Text = args.BenchPath.PressIn.Cfg.Name; - prOutCmpntLabel.Text = args.BenchPath.PressOut.Cfg.Name; - tInCmpntLabel.Text = args.BenchPath.TempIn.Cfg.Name; - tOutCmpntLabel.Text = args.BenchPath.TempOut.Cfg.Name; - tDivCmpntLabel.Text = args.OutputPath.TempDiv.Cfg.Name; - refFlowCmpntLabel.Text = args.OutputPath.FlowMeter.Cfg.Name; - regValveCmpntLabel.Text = args.OutputPath.RegulValve.Cfg.Name; - scaleCmpntLabel.Text = args.OutputPath.Balance.Cfg.Name; + if (args.BenchPath.PressIn != null) prInCmpntLabel.Text = args.BenchPath.PressIn.Name; + if (args.BenchPath.PressOut != null) prOutCmpntLabel.Text = args.BenchPath.PressOut.Name; + if (args.BenchPath.TempIn != null) tInCmpntLabel.Text = args.BenchPath.TempIn.Name; + if (args.BenchPath.TempOut != null) tOutCmpntLabel.Text = args.BenchPath.TempOut.Name; + if (args.OutputPath.TempDiv != null) tDivCmpntLabel.Text = args.OutputPath.TempDiv.Name; + if (args.OutputPath.FlowMeter != null) refFlowCmpntLabel.Text = args.OutputPath.FlowMeter.Name; + if (args.OutputPath.RegulValve != null) regValveCmpntLabel.Text = args.OutputPath.RegulValve.Name; + if (args.OutputPath.Balance != null) scaleCmpntLabel.Text = args.OutputPath.Balance.Name; sensor1Label.Text = (args.MetersPath.RegisterReaders[0] == null) ? "" : args.MetersPath.RegisterReaders[0].Cfg.Name; if (Program.WMsCount >= 2)