// ✔ private void AHMeasurement(ref double fullV, ref double iLimit, Keithley2280BatteryTestMeasureESRIntervalEnum interval) // ref interval mono ama thelw na kanw kapoio elegxo kai na to allazw endexomenws { CheckRange(ref fullV, 0, 21); driver.Battery.Test.Measure.FullVoltageInAH["1"] = fullV; // Full Voltage CheckRange(ref iLimit, 0.1, 6.1); driver.Battery.Test.Measure.CurrentLimitInAH["1"] = iLimit; // End Condition driver.Battery.Test.Measure.ConfigureAHMeasurement("1", fullV, iLimit, interval); driver.Battery.Test.Measure.AHMeasurementState["1"] = Keithley2280BatteryTestAHMeasurementStateEnum.Keithley2280BatteryTestAHMeasurementStateStart; // pote end? driver.System.DirectIO.WriteString(":STAT:OPER:INST:ISUM:COND?"); string response = driver.System.DirectIO.ReadString(); Console.WriteLine(response); }
// ✔ private void FullyDischargeBattery(ref double vLevel, ref double endCond) { CheckRange(ref vLevel, 0, 21); CheckRange(ref endCond, 0.1, 6.1); driver.Battery.OutputState["1"] = Keithley2280BatteryOutputStateEnum.Keithley2280BatteryOutputStateOn; while (driver.Battery.OutputState["1"] == Keithley2280BatteryOutputStateEnum.Keithley2280BatteryOutputStateOn) { System.Threading.Thread.Sleep(20000); } double x = -1; double y = -1; Keithley2280BatteryTestMeasureESRIntervalEnum z = Keithley2280BatteryTestMeasureESRIntervalEnum.Keithley2280BatteryTestMeasureESRInterval10Min; SelectESRInterval(ref z); AHMeasurement(ref x, ref y, z); }
// ✔ public void SelectESRInterval(ref Keithley2280BatteryTestMeasureESRIntervalEnum esrInterval) { Console.WriteLine("Select interval between AH Measurements"); Console.WriteLine("Available options are:"); Console.WriteLine("1. 10 seconds"); Console.WriteLine("2. 30 seconds"); Console.WriteLine("3. 60 seconds"); Console.WriteLine("4. 120 seconds"); Console.WriteLine("5. 10 minutes"); Console.WriteLine("Please selecto one of the following options by inserting the desired index number"); int choice = Convert.ToInt32(Console.ReadLine()); Switch: switch (choice) { case 1: esrInterval = Keithley2280BatteryTestMeasureESRIntervalEnum.Keithley2280BatteryTestMeasureESRInterval10Sec; break; case 2: esrInterval = Keithley2280BatteryTestMeasureESRIntervalEnum.Keithley2280BatteryTestMeasureESRInterval30Sec; break; case 3: esrInterval = Keithley2280BatteryTestMeasureESRIntervalEnum.Keithley2280BatteryTestMeasureESRInterval60Sec; break; case 4: esrInterval = Keithley2280BatteryTestMeasureESRIntervalEnum.Keithley2280BatteryTestMeasureESRInterval120Sec; break; case 5: esrInterval = Keithley2280BatteryTestMeasureESRIntervalEnum.Keithley2280BatteryTestMeasureESRInterval10Min; break; default: Console.WriteLine("Wrong index Value. Please try again"); choice = Convert.ToInt32(Console.ReadLine()); goto Switch; } }