Click here to Skip to main content
15,881,852 members
Home / Discussions / C#
   

C#

 
GeneralRe: multi threading problem??? Pin
Mycroft Holmes9-Aug-08 14:11
professionalMycroft Holmes9-Aug-08 14:11 
QuestionGetting all Forms in the project Pin
mrcooll9-Aug-08 5:48
mrcooll9-Aug-08 5:48 
AnswerRe: Getting all Forms in the project Pin
Wendelius9-Aug-08 6:00
mentorWendelius9-Aug-08 6:00 
QuestionHow to get a particular number of bytes or a null terminated string from serial port? [modified] Pin
CelestialCoder9-Aug-08 4:42
CelestialCoder9-Aug-08 4:42 
AnswerRe: How to get a particular number of bytes or a null terminated string from serial port? Pin
Searril9-Aug-08 5:00
Searril9-Aug-08 5:00 
GeneralRe: How to get a particular number of bytes or a null terminated string from serial port? Pin
CelestialCoder9-Aug-08 5:06
CelestialCoder9-Aug-08 5:06 
GeneralRe: How to get a particular number of bytes or a null terminated string from serial port? Pin
CelestialCoder12-Aug-08 1:56
CelestialCoder12-Aug-08 1:56 
GeneralRe: How to get a particular number of bytes or a null terminated string from serial port? Pin
CelestialCoder13-Aug-08 17:36
CelestialCoder13-Aug-08 17:36 
I think I have found some clue.
To get a particular number of bytes we can set the receive threshold as ..say 20. Then receive event will be triggered when serial port receives 20bytes.

Unlike in Micro controllers windows cannot give events (Interrupts ) guaranteed for every byte received. I have tried by making a device connected to serial port which sends some lengthy strings. If I send bytes with a few 10s of milliseconds gap from the embedded device, I am getting an event for every byte. But if I send a continuous data stream with no delay in between, events are triggered at no uniform intervals. sometimes 8 bytes sometimes 40 bytes. even if receive threshold is set to 1 byte.

So what I found as the best method is make receive threshold as 1 byte, on receive event use BytesToRead method to get all bytes received so far and append it to a string. also on every event clear a timer count to 0. When the packet ends the timer count will not gets cleared in time so that it will climb up and creates a user event.(working on that)on the event can check for a EOF to confirm a valid packet.

Why this complex machine cannot give a timely event while a small Microcontroller can do it in correct time?

With Regards
Roy Thomas

"..this file is known as source file probably because it is a source of frustration and anxiety!" - Chuck Sphar - In book 'C# 2005 for Dummies'.

QuestionC# windows application deployment error Pin
vishnukamath9-Aug-08 3:40
vishnukamath9-Aug-08 3:40 
QuestionCounting number of characters Pin
Zafar Sultan9-Aug-08 3:35
Zafar Sultan9-Aug-08 3:35 
AnswerRe: Counting number of characters Pin
User 66589-Aug-08 4:43
User 66589-Aug-08 4:43 
QuestionMobile programming Pin
ali zaidi9-Aug-08 3:25
ali zaidi9-Aug-08 3:25 
AnswerRe: Mobile programming Pin
mr.mohsen9-Aug-08 6:09
mr.mohsen9-Aug-08 6:09 
QuestionOnchange event is not triggering events on text elements in c# Pin
Nupur2069-Aug-08 3:03
Nupur2069-Aug-08 3:03 
QuestionHow can I copy a block of memory? Pin
CopperCircle9-Aug-08 2:22
CopperCircle9-Aug-08 2:22 
AnswerRe: How can I copy a block of memory? Pin
User 66589-Aug-08 2:29
User 66589-Aug-08 2:29 
GeneralRe: How can I copy a block of memory? Pin
CopperCircle9-Aug-08 2:39
CopperCircle9-Aug-08 2:39 
GeneralRe: How can I copy a block of memory? Pin
Guffa9-Aug-08 7:53
Guffa9-Aug-08 7:53 
GeneralRe: How can I copy a block of memory? Pin
CopperCircle9-Aug-08 11:47
CopperCircle9-Aug-08 11:47 
AnswerRe: How can I copy a block of memory? Pin
Guffa9-Aug-08 22:17
Guffa9-Aug-08 22:17 
GeneralRe: How can I copy a block of memory? Pin
CopperCircle10-Aug-08 0:21
CopperCircle10-Aug-08 0:21 
AnswerRe: How can I copy a block of memory? Pin
#realJSOP10-Aug-08 1:19
mve#realJSOP10-Aug-08 1:19 
AnswerRe: How can I copy a block of memory? Pin
CopperCircle10-Aug-08 2:32
CopperCircle10-Aug-08 2:32 
Questionsend mail using C# Pin
sobhaniir9-Aug-08 0:41
sobhaniir9-Aug-08 0:41 
AnswerRe: send mail using C# PinPopular
Guffa9-Aug-08 0:50
Guffa9-Aug-08 0:50 

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.