port.Parity = Parity.None; port.DataBits = 8; port.StopBits = StopBits.One; port.Encoding = System.Text.Encoding.ASCII; port.Name ="COM1"; port.BaudRate=9600; port.DataReceived += Port_DataReceived;
port.RtsEnable = true; port.Write(System.Text.Encoding.ASCII.GetBytes(dataToSend), 0, dataToSend.Length); Thread.Sleep(15); port.RtsEnable = false;
Quote:The DataReceived event is not guaranteed to be raised for every byte received. Use the BytesToRead property to determine how much data is left to be read in the buffer.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)