Click here to Skip to main content
15,895,656 members
Home / Discussions / C#
   

C#

 
GeneralRe: COM port send/receive Pin
mprice2148-Apr-10 14:20
mprice2148-Apr-10 14:20 
GeneralRe: COM port send/receive Pin
PIEBALDconsult8-Apr-10 17:13
mvePIEBALDconsult8-Apr-10 17:13 
GeneralRe: COM port send/receive Pin
mprice2149-Apr-10 2:25
mprice2149-Apr-10 2:25 
GeneralRe: COM port send/receive Pin
PIEBALDconsult9-Apr-10 3:22
mvePIEBALDconsult9-Apr-10 3:22 
GeneralRe: COM port send/receive Pin
mprice2149-Apr-10 3:46
mprice2149-Apr-10 3:46 
GeneralRe: COM port send/receive Pin
PIEBALDconsult9-Apr-10 4:09
mvePIEBALDconsult9-Apr-10 4:09 
AnswerRe: COM port send/receive Pin
Rajesh Anuhya9-Apr-10 2:36
professionalRajesh Anuhya9-Apr-10 2:36 
GeneralRe: COM port send/receive Pin
mprice21412-Apr-10 4:42
mprice21412-Apr-10 4:42 
Hi Rajesh,

The issue I'm now having is that using a timer doesn't seem to be the most deterministic approach. In other words, I have a string that is written to the device at certain intervals. The serial data received method (SerialDataReceivedEventArgs) then Invokes the function that writes the returned string to a text box. However, to make sure the entire string is sitting in the buffer to be read, there is the Thread.Sleep. This seems very ineffecient and I'm trying to verify if that assumption is correct. What I would like to do is to write and read as fast as possible without the thread getting all tied up with timing issues. The device I'm talking to sends a carriage return at the end of the string. It seems that the fastest way to do this would be if I have a loop that writes a command string/waits for the string ending with a cr/writes that read value to whatever (textbox, etc) and writes the command string again.

Since I am new to this, I'm not sure if the stopwatch is the way to go, but I think a timer/thread.sleep combination is asking for crashing problems when I'm trying to do this a fast as possible.

Thoughts?
GeneralRe: COM port send/receive Pin
mprice21412-Apr-10 7:51
mprice21412-Apr-10 7:51 
QuestionC# : Dispaly data in paragraph format Pin
Member 34895988-Apr-10 2:55
Member 34895988-Apr-10 2:55 
AnswerRe: C# : Dispaly data in paragraph format Pin
Abhinav S8-Apr-10 3:29
Abhinav S8-Apr-10 3:29 
QuestionGetting strings and ints of another class Pin
BuggingMe8-Apr-10 2:15
BuggingMe8-Apr-10 2:15 
AnswerRe: Getting strings and ints of another class Pin
Sunil Scaria8-Apr-10 2:43
Sunil Scaria8-Apr-10 2:43 
AnswerRe: Getting strings and ints of another class Pin
Arun Jacob8-Apr-10 2:48
Arun Jacob8-Apr-10 2:48 
GeneralRe: Getting strings and ints of another class Pin
BuggingMe8-Apr-10 2:52
BuggingMe8-Apr-10 2:52 
GeneralRe: Getting strings and ints of another class Pin
Sunil Scaria8-Apr-10 2:58
Sunil Scaria8-Apr-10 2:58 
AnswerRe: Getting strings and ints of another class Pin
Arun Jacob8-Apr-10 3:12
Arun Jacob8-Apr-10 3:12 
GeneralRe: Getting strings and ints of another class Pin
BuggingMe8-Apr-10 3:30
BuggingMe8-Apr-10 3:30 
QuestionSafe handle has been closed appears on program exit Pin
yeah10008-Apr-10 2:00
yeah10008-Apr-10 2:00 
AnswerRe: Safe handle has been closed appears on program exit Pin
Alan N8-Apr-10 4:35
Alan N8-Apr-10 4:35 
AnswerRe: Safe handle has been closed appears on program exit Pin
supercat98-Apr-10 9:30
supercat98-Apr-10 9:30 
GeneralVirus removal tool (Team Project). Pin
MS-EULA8-Apr-10 1:31
MS-EULA8-Apr-10 1:31 
GeneralTo Up Pin
MS-EULA9-Apr-10 2:01
MS-EULA9-Apr-10 2:01 
Questionopen an exe file in panel Pin
MarziehA8-Apr-10 0:34
MarziehA8-Apr-10 0:34 
AnswerRe: open an exe file in panel Pin
Eddy Vluggen8-Apr-10 6:14
professionalEddy Vluggen8-Apr-10 6:14 

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.