Esempio n. 1
0
        static void Main(string[] args)
        {
            System.Console.WriteLine("Rapid 85-1753 Programmable power supply Example program");
            System.Console.WriteLine("Select the COM port of the power supply");

            var portName = GetPortName();

            Console.WriteLine("Enter the address of the Power suppply:");

            var         address = GetUserInt();
            PowerSupply supply  = new PowerSupply(portName, 1);

            supply.Connect();
            supply.Output(false);

            System.Console.Write("Enter a desired output voltage: ");

            var voltage = GetUserDec();

            supply.SetV(voltage);

            System.Console.Write("Enter a desired output current Limit: ");

            var current = GetUserDec();

            supply.SetI(current);

            System.Console.WriteLine("Get setpoints from supply.");

            System.Console.WriteLine(supply.GetSetpoints());

            System.Console.WriteLine("press enter to turn on supply output");

            System.Console.ReadLine();
            supply.Output(true);

            System.Console.WriteLine("press return to get measurments from the Power supply");

            System.Console.ReadLine();
            System.Console.WriteLine(supply.GetMesurments());

            Console.WriteLine("Paused to read results, Press return to quit.");
            Console.ReadLine();
            supply.Dispose();
        }