I have writen a serial port program. I used Serialport class in C#.
If I readbyte(), readchar() or other function I doesn't get first character.
please find my sample below.
_serialPort.Read(oku, oku.Length, 0);
oku = (
Assume that you have sent “abcd”; do you just receive “bcd”?
And would you please be more specific? Such as the property setting of the serial port.
By the way, is oku an array or a byte variable in your code? It seems an array in the first part, but you use it as a byte variable.
Thanks your reply.
Yes I send "abcd" with byte. But I get bcd.
Oku is byte array.
sport.PortName = portName;
sport.BaudRate = baudRate;
sport.DataBits = dataBits;
sport.Parity = (System.IO.Ports.
sport.ReadTimeout = 500;
sport.WriteTimeout = 500;
Thank you very much for your interested.
Microsoft is conducting an online survey to understand your opinion of the Msdn Web site. If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site.
Would you like to participate?