Serial port problem

V

vorange

I can successfully send a character from my C# program to the serial
port to a device. But when I have that device send me back a character
and I read it in, I get the same character that I sent out!

What is going on here. I have verified that the device is indeed
sending back the proper character that I want.

But for some reason, my C# program only shows the char I sent out. Its
like its being echoed back. Why :( ?

I'm using a DataReceived event to handle the incoming byte and this
code to read the byte :

int i = 0;
i = port.ReadByte();
str2 = i.ToString();
MessageBox.Show (str2);
 
M

Michael A. Covington

One possibility, of course, is that your sent character *is* being echoed
back by the external device. If you have not already done so, you might try
a terminal program (Hyperterm or something) to communicate with the same
device, to see how it's behaving.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top