- I am not good at writing but below is few from my collection.
- Declare the Port variable globally in a form.
- SerialPort Port;
- string PORT_NUMBER = "YOUR PORT NUMBER" ;
- Set the port properties in Form load.
try
- Above is the basic procedure and easy to understand.
- Now create following function which will be helpful to read data from serial port simultaneously.
private void ReadEvent()
//To decode the received data from the port.
It will keep assigning same event when data received.
Port.BaseStream.BeginRead
Never fails and will give you each and every bit from the Port.
To invoke this you need to Call Port.WriteLine("AT COMMAND");
Hope it helps someone who is stuck with ports.
This comment has been removed by the author.
ReplyDeleteVery good Excellent articular and very helpful , easily apply and run successfully
ReplyDeleteWow!!
ReplyDeleteExcellent job , easily applicable and
run successfully.
Thanks