Click here to Skip to main content
15,889,281 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to make resistor color code Pin
Dave Kreskowiak12-Feb-12 4:39
mveDave Kreskowiak12-Feb-12 4:39 
AnswerRe: How to make resistor color code Pin
Luc Pattyn12-Feb-12 9:32
sitebuilderLuc Pattyn12-Feb-12 9:32 
RantRe: How to make resistor color code Pin
Paladin200013-Feb-12 7:47
Paladin200013-Feb-12 7:47 
QuestionDigit Presents Windows phone application development contest Pin
PrateekN11-Feb-12 8:48
PrateekN11-Feb-12 8:48 
QuestionHow to Handle DatagridView's keydown event during editing of cell Pin
Nabawoka11-Feb-12 6:27
Nabawoka11-Feb-12 6:27 
AnswerRe: How to Handle DatagridView's keydown event during editing of cell Pin
Nabawoka11-Feb-12 20:57
Nabawoka11-Feb-12 20:57 
QuestionPlease help me understand serial communication Pin
turbosupramk311-Feb-12 5:52
turbosupramk311-Feb-12 5:52 
AnswerRe: Please help me understand serial communication Pin
OriginalGriff11-Feb-12 9:50
mveOriginalGriff11-Feb-12 9:50 
Serial communication is just that: data arrives as a stream of databits, some of which are parts of characters, others are framing which wrap the characters and provide a way to identify when they start, stop, and if there are received correctly.

When the bit stream arrives at the hardware, it finds each character one by one and hands that on to the OS software. The software hands it to the .NET framework, which then raises an event to tell you that there is data. While the OS and the framework are doing this, and while your program is sorting itself out to process the character, the databits are still arriving, and still being processed by the hardware into characters - and it is telling the OS each time it has one. So, when your program finally gets allowed to look at the data (and bear in mind that may not be immediately as Windows in a multitasking OS) there could be anything from one character to the whole message waiting for you. If may take one, or many DataRecieved Events to receive the whole message - and the number could be completely different next time you try because what else is going on in the whole system is different.

You can't just look at the currently available data - you have to look at the whole message. Which means you need to buffer it up until you have got to the end of the message, or a suitable amount of time has passed without getting the whole message. if you just read the data into a single string each time you get a DataRecieved event, all you will do is most likely throw away the data you have already got...
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

GeneralRe: Please help me understand serial communication Pin
turbosupramk311-Feb-12 11:09
turbosupramk311-Feb-12 11:09 
AnswerRe: Please help me understand serial communication Pin
Luc Pattyn11-Feb-12 11:31
sitebuilderLuc Pattyn11-Feb-12 11:31 
GeneralRe: Please help me understand serial communication Pin
turbosupramk311-Feb-12 11:56
turbosupramk311-Feb-12 11:56 
GeneralRe: Please help me understand serial communication Pin
turbosupramk311-Feb-12 15:29
turbosupramk311-Feb-12 15:29 
AnswerRe: Please help me understand serial communication Pin
Luc Pattyn11-Feb-12 15:51
sitebuilderLuc Pattyn11-Feb-12 15:51 
GeneralRe: Please help me understand serial communication Pin
turbosupramk311-Feb-12 22:31
turbosupramk311-Feb-12 22:31 
AnswerRe: Please help me understand serial communication Pin
Luc Pattyn11-Feb-12 23:34
sitebuilderLuc Pattyn11-Feb-12 23:34 
GeneralRe: Please help me understand serial communication Pin
turbosupramk312-Feb-12 4:11
turbosupramk312-Feb-12 4:11 
GeneralRe: Please help me understand serial communication Pin
Luc Pattyn12-Feb-12 10:43
sitebuilderLuc Pattyn12-Feb-12 10:43 
GeneralRe: Please help me understand serial communication Pin
turbosupramk312-Feb-12 11:06
turbosupramk312-Feb-12 11:06 
GeneralRe: Please help me understand serial communication Pin
turbosupramk312-Feb-12 16:40
turbosupramk312-Feb-12 16:40 
AnswerRe: Please help me understand serial communication Pin
Luc Pattyn13-Feb-12 3:10
sitebuilderLuc Pattyn13-Feb-12 3:10 
GeneralRe: Please help me understand serial communication Pin
turbosupramk313-Feb-12 3:18
turbosupramk313-Feb-12 3:18 
AnswerRe: Please help me understand serial communication Pin
Luc Pattyn13-Feb-12 3:31
sitebuilderLuc Pattyn13-Feb-12 3:31 
GeneralRe: Please help me understand serial communication Pin
turbosupramk313-Feb-12 4:00
turbosupramk313-Feb-12 4:00 
AnswerRe: Please help me understand serial communication Pin
Luc Pattyn13-Feb-12 4:12
sitebuilderLuc Pattyn13-Feb-12 4:12 
GeneralRe: Please help me understand serial communication Pin
turbosupramk313-Feb-12 4:18
turbosupramk313-Feb-12 4:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.