예제 #1
0
        public static void Sample3()
        {
            IPowerSupply powerSupply = PowerSupplyFactory.BKPrecisionComPort();       //Connect some other power supply (e.g. a Sorensen XG 1500) to COM port

            powerSupply.DisableOutputs();                                             //Disable outputs
            string actualVoltage = powerSupply.ReadActualVoltage();                   //Read voltage

            if (actualVoltage == "")                                                  //it is expected that it is impossible to read the voltage
            {
                Console.WriteLine("Power Supply over Com port works correctly.");
            }
            else
            {
                Console.WriteLine("After disabling it's possible read out the outputs.");
            }
            powerSupply.Disconnect();                                                  //Disconect from COM port
        }
예제 #2
0
        public static void Sample1()
        {
            var          voltage     = 20;
            IPowerSupply powerSupply = PowerSupplyFactory.BKPrecision9132BComPort();     //Connect BK Precision 9132B to COM port

            powerSupply.EnableOutputs();                                                 //Enable outputs
            powerSupply.SetVoltage(voltage);                                             //Set voltage
            string actualVoltage = powerSupply.ReadActualVoltage();                      //Read voltage

            if ((actualVoltage != "") && (voltage == Convert.ToInt32(actualVoltage)))    //Compare voltages
            {
                Console.WriteLine("Power Supply BKPrecision 9132B over Com port works correctly.");
            }
            else
            {
                Console.WriteLine("The set and actual voltage is not equal.");
            }
            powerSupply.Disconnect();                                                    //Disconect from COM port
        }