Click here to Skip to main content
15,868,141 members
Home / Discussions / C#
   

C#

 
AnswerRe: how to insert unknown amount of data into a database Pin
OriginalGriff11-Oct-20 8:33
mveOriginalGriff11-Oct-20 8:33 
AnswerRe: how to insert unknown amount of data into a database Pin
jsc4213-Oct-20 3:50
professionaljsc4213-Oct-20 3:50 
QuestionWhy am I not allowed to do this with events Pin
Keith Barrow9-Oct-20 1:20
professionalKeith Barrow9-Oct-20 1:20 
AnswerRe: Why am I not allowed to do this with events Pin
Richard Deeming9-Oct-20 2:12
mveRichard Deeming9-Oct-20 2:12 
GeneralRe: Why am I not allowed to do this with events Pin
Keith Barrow9-Oct-20 3:19
professionalKeith Barrow9-Oct-20 3:19 
QuestionHow to read from serial port until timeout of no more data received? Pin
td17768-Oct-20 13:27
td17768-Oct-20 13:27 
AnswerRe: How to read from serial port until timeout of no more data received? Pin
Luc Pattyn8-Oct-20 14:27
sitebuilderLuc Pattyn8-Oct-20 14:27 
GeneralRe: How to read from serial port until timeout of no more data received? Pin
td17768-Oct-20 15:36
td17768-Oct-20 15:36 
Thanks for the reply, Luc.

I'm OK with all of the points you posted - It's a fairly simple data logger, so wonky multiple events firing and millisecond timing isn't important (75-100ms was still occasionally creating a second file for the last dozen or two characters, so I just bumped it up to .75s) and I'm manipulating the UI by display code in another class from within the thread.

The artificial latency of the first suggestion doesn't bother me, but I don't think that will work. Although all of the data from a single burst would arrive in X ms, occasionally two data bursts may come close together, so a static wait time could feasibly end too early.

I need to figure out a way to to capture everything from the initial DataReceived event until X ms after the line goes silent. I had a ReadTimeout set on the port, but it didn't behave the way I was expecting with ReadExisting (that is, it didn't keep trying to read until hitting the time limit). I'll look into the rest of your second suggestion. Thanks again.
GeneralRe: How to read from serial port until timeout of no more data received? Pin
Luc Pattyn9-Oct-20 1:25
sitebuilderLuc Pattyn9-Oct-20 1:25 
AnswerRe: How to read from serial port until timeout of no more data received? Pin
Gerry Schmitz8-Oct-20 18:27
mveGerry Schmitz8-Oct-20 18:27 
GeneralRe: How to read from serial port until timeout of no more data received? Pin
td17769-Oct-20 11:16
td17769-Oct-20 11:16 
GeneralRe: How to read from serial port until timeout of no more data received? Pin
Gerry Schmitz9-Oct-20 14:10
mveGerry Schmitz9-Oct-20 14:10 
AnswerRe: How to read from serial port until timeout of no more data received? Pin
Richard MacCutchan8-Oct-20 22:55
mveRichard MacCutchan8-Oct-20 22:55 
AnswerMy (temporary?) solution Pin
td17769-Oct-20 11:25
td17769-Oct-20 11:25 
QuestionCOM exception loss Pin
Member 126326017-Oct-20 20:57
Member 126326017-Oct-20 20:57 
AnswerRe: COM exception loss Pin
Richard MacCutchan7-Oct-20 21:35
mveRichard MacCutchan7-Oct-20 21:35 
GeneralRe: COM exception loss Pin
Member 126326017-Oct-20 22:03
Member 126326017-Oct-20 22:03 
GeneralRe: COM exception loss Pin
Richard MacCutchan7-Oct-20 22:25
mveRichard MacCutchan7-Oct-20 22:25 
GeneralRe: COM exception loss Pin
Member 126326017-Oct-20 22:58
Member 126326017-Oct-20 22:58 
GeneralRe: COM exception loss Pin
Richard MacCutchan7-Oct-20 23:24
mveRichard MacCutchan7-Oct-20 23:24 
AnswerRe: COM exception loss Pin
OriginalGriff8-Oct-20 4:10
mveOriginalGriff8-Oct-20 4:10 
QuestionScanning for servers Pin
pkfox4-Oct-20 21:52
professionalpkfox4-Oct-20 21:52 
AnswerRe: Scanning for servers Pin
Richard Deeming5-Oct-20 2:44
mveRichard Deeming5-Oct-20 2:44 
GeneralRe: Scanning for servers Pin
pkfox5-Oct-20 3:44
professionalpkfox5-Oct-20 3:44 
GeneralRe: Scanning for servers Pin
pkfox5-Oct-20 4:17
professionalpkfox5-Oct-20 4:17 

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.