public void SerialPortReadVoltage() { event_1.Reset(); Trace.Listeners.Add(new TextWriterTraceListener(Console.Out)); Trace.WriteLine($"SerialPortReadVoltage"); var serial = new SerialConnection(); serial.Open(_port, 9600, Parity.None, StopBits.One, 8, Handshake.None, NewLine.SlashN, ReadMode.ReadChunksTillNoneMore); serial.SendCommand("VOUT1?"); event_1.WaitOne(timeout: TimeSpan.FromSeconds(3)); serial.ClosePort(); }
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(); }