Click here to Skip to main content
15,887,746 members
Home / Discussions / C#
   

C#

 
Question[SOLVED] GUI Problem - Added Forms To Tab Control Pin
AmbiguousName15-Jul-12 20:40
AmbiguousName15-Jul-12 20:40 
AnswerRe: [SOLVED] GUI Problem - Added Forms To Tab Control Pin
Obaid ur Rehman15-Jul-12 23:25
Obaid ur Rehman15-Jul-12 23:25 
AnswerRe: [SOLVED] GUI Problem - Added Forms To Tab Control Pin
AmbiguousName16-Jul-12 0:54
AmbiguousName16-Jul-12 0:54 
Generalwhat info is needed to detect a HtmlElement in WebBrowser Pin
linuor15-Jul-12 19:47
linuor15-Jul-12 19:47 
GeneralRe: what info is needed to detect a HtmlElement in WebBrowser Pin
Richard MacCutchan15-Jul-12 22:20
mveRichard MacCutchan15-Jul-12 22:20 
GeneralRe: what info is needed to detect a HtmlElement in WebBrowser Pin
linuor16-Jul-12 3:15
linuor16-Jul-12 3:15 
GeneralRe: what info is needed to detect a HtmlElement in WebBrowser Pin
Richard MacCutchan16-Jul-12 3:57
mveRichard MacCutchan16-Jul-12 3:57 
GeneralSerial Port Read Timeout Problem Pin
Richard Andrew x6415-Jul-12 18:21
professionalRichard Andrew x6415-Jul-12 18:21 
Receiving data from an external device with the SerialPort class.

I set the ReadTimeout property variably from 500ms to 5000ms.

Problem:

The ReadLine() method blocks until the exact amount of time equal to the ReadTimeout property transpires even when data arrives immediately at the port.

This means that if I set the ReadTimeout to 5000, then the ReadLine() method will block for 5 seconds even if data has arrived within 10ms at the port.

I set the NewLine property to
C#
'\r'
because that is the delimiter that indicates a full packet of data has arrived.

Has anyone else seen this behavior, or have any idea how to work around it so that the ReadLine() method will return as soon as data is received?

Here is how I set up the port:

C#
Port.BaudRate = 19200;
Port.DataBits = 8;
Port.Parity = System.IO.Ports.Parity.None;
Port.StopBits = System.IO.Ports.StopBits.One;
Port.NewLine = "\r";
Port.ReadTimeout = Convert.ToInt32(textBoxTimeout.Text);




The difficult we do right away...
...the impossible takes slightly longer.

GeneralRe: Serial Port Read Timeout Problem Pin
Peter_in_278015-Jul-12 19:30
professionalPeter_in_278015-Jul-12 19:30 
GeneralRe: Serial Port Read Timeout Problem Pin
Richard Andrew x6415-Jul-12 19:55
professionalRichard Andrew x6415-Jul-12 19:55 
GeneralRe: Serial Port Read Timeout Problem Pin
SoMad15-Jul-12 20:45
professionalSoMad15-Jul-12 20:45 
GeneralRe: Serial Port Read Timeout Problem Pin
glennPattonWork315-Jul-12 22:38
professionalglennPattonWork315-Jul-12 22:38 
QuestionStart Debugger "from running program" Pin
Tomerland15-Jul-12 9:12
Tomerland15-Jul-12 9:12 
GeneralRe: Start Debugger "from running program" Pin
PIEBALDconsult15-Jul-12 9:23
mvePIEBALDconsult15-Jul-12 9:23 
AnswerRe: Start Debugger "from running program" Pin
Eddy Vluggen15-Jul-12 10:49
professionalEddy Vluggen15-Jul-12 10:49 
AnswerRe: Start Debugger "from running program" Pin
markovl15-Jul-12 23:06
markovl15-Jul-12 23:06 
AnswerRe: Start Debugger "from running program" Pin
jschell16-Jul-12 6:08
jschell16-Jul-12 6:08 
QuestionAdding Element Host to Datagridview Pin
amirmn715-Jul-12 6:31
amirmn715-Jul-12 6:31 
Questiona mask control in windows form application Pin
jokercocol14-Jul-12 6:52
jokercocol14-Jul-12 6:52 
AnswerRe: a mask control in windows form application Pin
Abhinav S14-Jul-12 7:19
Abhinav S14-Jul-12 7:19 
AnswerRe: a mask control in windows form application Pin
BillWoodruff14-Jul-12 14:08
professionalBillWoodruff14-Jul-12 14:08 
GeneralRe: a mask control in windows form application Pin
jokercocol15-Jul-12 2:05
jokercocol15-Jul-12 2:05 
AnswerRe: a mask control in windows form application Pin
OriginalGriff15-Jul-12 3:03
mveOriginalGriff15-Jul-12 3:03 
GeneralRe: a mask control in windows form application Pin
Dave Kreskowiak15-Jul-12 3:07
mveDave Kreskowiak15-Jul-12 3:07 
GeneralRe: a mask control in windows form application Pin
jokercocol15-Jul-12 6:59
jokercocol15-Jul-12 6:59 

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.