Click here to Skip to main content
15,896,402 members
Home / Discussions / C#
   

C#

 
GeneralRe: Help with serial data display Pin
ColinBurnell9-Nov-10 21:41
professionalColinBurnell9-Nov-10 21:41 
GeneralRe: Help with serial data display Pin
turbosupramk310-Nov-10 2:23
turbosupramk310-Nov-10 2:23 
GeneralRe: Help with serial data display Pin
ColinBurnell10-Nov-10 21:20
professionalColinBurnell10-Nov-10 21:20 
AnswerRe: Help with serial data display Pin
Luc Pattyn9-Nov-10 7:26
sitebuilderLuc Pattyn9-Nov-10 7:26 
GeneralRe: Help with serial data display Pin
turbosupramk39-Nov-10 7:42
turbosupramk39-Nov-10 7:42 
AnswerRe: Help with serial data display Pin
Luc Pattyn9-Nov-10 7:50
sitebuilderLuc Pattyn9-Nov-10 7:50 
GeneralRe: Help with serial data display Pin
turbosupramk39-Nov-10 10:31
turbosupramk39-Nov-10 10:31 
GeneralRe: Help with serial data display Pin
Luc Pattyn9-Nov-10 10:52
sitebuilderLuc Pattyn9-Nov-10 10:52 
I suggest you validate the incoming bytes somehow. I see basically two ways to do that:

1.
use a terminal emulator (such as good old HyperTerminal) and see what comes in.

2.
better, use SerialPort class in binary mode, basically something along these lines:
SerialPort port=new SerialPort();
// take care of opening and port settings
...
// do whatever is needed to have the peripheral send something
...
// wait for enough data to arrive
Thread.Sleep(5000);
// read all of it now
int DIM=300;
byte[] bytes=new byte[DIM];
int n=port.Read(bytes,0,DIM);
for(int i=0; i<n; i++) {
    byte b=bytes[i];
    char c=b;
    log("bytes["+i+"]=0x"+b.ToString("X2")+"="+c);
}


where log is a simple logging method, could be:
public static void log(string s) {
    Console.WriteLine(s);
}


Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.


GeneralRe: Help with serial data display Pin
turbosupramk39-Nov-10 16:24
turbosupramk39-Nov-10 16:24 
GeneralRe: Help with serial data display Pin
Luc Pattyn9-Nov-10 16:48
sitebuilderLuc Pattyn9-Nov-10 16:48 
GeneralRe: Help with serial data display Pin
turbosupramk310-Nov-10 3:03
turbosupramk310-Nov-10 3:03 
GeneralRe: Help with serial data display Pin
NedPat10-Nov-10 19:38
NedPat10-Nov-10 19:38 
GeneralRe: Help with serial data display Pin
ShafiqA11-Nov-10 18:29
ShafiqA11-Nov-10 18:29 
GeneralRe: Help with serial data display Pin
Adam Yonce10-Nov-10 2:50
Adam Yonce10-Nov-10 2:50 
GeneralRe: Help with serial data display Pin
turbosupramk310-Nov-10 3:05
turbosupramk310-Nov-10 3:05 
NewsRe: Help with serial data display Pin
turbosupramk310-Nov-10 14:41
turbosupramk310-Nov-10 14:41 
AnswerRe: Help with serial data display Pin
davidwz9-Nov-10 19:04
davidwz9-Nov-10 19:04 
AnswerRe: Help with serial data display Pin
DarthDana10-Nov-10 4:59
professionalDarthDana10-Nov-10 4:59 
QuestionHow can I get the filename and sourcepath of a running process? Pin
Erik8-Nov-10 23:52
Erik8-Nov-10 23:52 
AnswerMessage Closed Pin
9-Nov-10 0:15
stancrm9-Nov-10 0:15 
GeneralRe: How can I get the filename and sourcepath of a running process? Pin
RaviRanjanKr9-Nov-10 3:56
professionalRaviRanjanKr9-Nov-10 3:56 
AnswerRe: How can I get the filename and sourcepath of a running process? Pin
RaviRanjanKr9-Nov-10 3:55
professionalRaviRanjanKr9-Nov-10 3:55 
AnswerRe: How can I get the filename and sourcepath of a running process? Pin
Luc Pattyn9-Nov-10 4:10
sitebuilderLuc Pattyn9-Nov-10 4:10 
GeneralRe: How can I get the filename and sourcepath of a running process? Pin
RaviRanjanKr9-Nov-10 4:24
professionalRaviRanjanKr9-Nov-10 4:24 
GeneralRe: How can I get the filename and sourcepath of a running process? Pin
ShilpaKumari10-Nov-10 0:20
ShilpaKumari10-Nov-10 0:20 

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.