Count byte from Rs232
Hello ,every body .I want to count byte from Com transmit .Can you help me .I am using C#
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jaganathan BantheswaranPosted Feb 27, 2011, 11:23 PM
Did you try this?
byteArray is a variable which is type of byte Arrary. you have to declare the byteArray as given below.
byte[] byteArray = new byteArray[1024];
toanhoi buiPosted Feb 27, 2011, 9:35 PM
Jaganathan BantheswaranPosted Feb 26, 2011, 7:19 AM
//configuring the serial port
serialPort1.PortName="COM1";
serialPort1.BaudRate=9600;
serialPort1.DataBits=8;
serialPort1.Parity=Parity.None;
serialPort1.StopBits= StopBits.One;
//opening the serial port
serialPort1.Open();
serialPort1.Read(byteArray,0,byteArray.Length);
//Returns the number of bytes in buffer.
serialPort1.BytesToRead;
For more clear details look at
http://www.c-sharpcorner.com/uploadfile/eclipsed4utoo/serialportcommunication12082008111137am/serialportcommunication.aspx,
http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.aspx?ppud=4