示例#1
0
        public void SerialPortSetVoltageOff()
        {
            event_1.Reset();
            Trace.Listeners.Add(new TextWriterTraceListener(Console.Out));
            Trace.WriteLine($"SerialPortSetVoltageOff");
            var serial = new SerialConnection();

            serial.Open(_port, 9600, Parity.None, StopBits.One, 8, Handshake.None, NewLine.SlashN, ReadMode.ReadChunksTillNoneMore);
            serial.PortDataRead += serial_dataReceived;
            serial.SendCommand("VSET1:0.00");
            Thread.Sleep(200);
            serial.SendCommand("VOUT1?");
            event_1.WaitOne(timeout: TimeSpan.FromSeconds(3));
            serial.ClosePort();
        }
示例#2
0
        public void SerialPortTestCommand()
        {
            event_1.Reset();

            Trace.Listeners.Add(new TextWriterTraceListener(Console.Out));
            Trace.WriteLine($"SerialPortTestCommand");
            var serial = new SerialConnection();

            serial.Open(_port, 9600, Parity.None, StopBits.One, 8, Handshake.None, NewLine.SlashN, ReadMode.ReadLine);
            serial.PortDataRead += serial_dataReceived;
            serial.SendCommand("*IDN?");
            event_1.WaitOne(timeout: TimeSpan.FromSeconds(3));
            serial.ClosePort();
        }