8/21/2019 My Visual Database Serial
My visual database serial numbers, cracks and keygens are presented here. No registration is needed. Just download and enjoy.
I just start to learn how to send and receive data from my hardware through the C# GUI.
Can anyone please write a detail how to read data from the serial port?
Lundin
117k1717 gold badges169169 silver badges280280 bronze badges
CHIENSION
3 Answers
SerialPort (RS-232 Serial COM Port) in C# .NET
This article explains how to use the SerialPort class in .NET to read and write data, determine what serial ports are available on your machine, and how to send files. It even covers the pin assignments on the port itself.
Example Code:
Cristian Ciupitu
15.3k55 gold badges4343 silver badges6666 bronze badges
Robert Harvey
![]()
151k3636 gold badges288288 silver badges425425 bronze badges
I spent a lot of time to use SerialPort class and has concluded to use SerialPort.BaseStream class instead. You can see source code: SerialPort-source and SerialPort.BaseStream-source for deep understanding.I created and use code that shown below.
![]()
.
YakovYakov
Note that usage of a
SerialPort.DataReceived event is optional. You can set proper timeout using SerialPort.ReadTimeout and continuously call SerialPort.Read() after you wrote something to a port until you get a full response.
Moreover you can use
SerialPort.BaseStream property to extract an underlying Stream instance. The benefit of using a Stream is that you can easily utilize various decorators with it:
For more information check:
7,80922 gold badges2222 silver badges4040 bronze badges
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |