开发者

C# serial rs232 parity error

开发者 https://www.devze.com 2022-12-19 02:28 出处:网络
I\'m trying to get a simple serial reader going in C# to read info from an rs232. I\'m using VS2008. I can receive data fine with HyperTerminal and python but开发者_如何转开发 I keep getting parity er

I'm trying to get a simple serial reader going in C# to read info from an rs232. I'm using VS2008. I can receive data fine with HyperTerminal and python but开发者_如何转开发 I keep getting parity errors every time I try to transmit a character to C#. Number's work fine, it's just the characters. It's configured exactly the same as HyperTerminal: 9600baud, 1 stopbits, no parity, no handshakes. What could be causing only the characters to mess up and not the numbers?


How can you have parity errors when the configuration is "no parity"?

Are you seeing failures of a checksum stored in the data stream (as opposed to RS-232 parity bits)? Are you getting exceptions when using the C# serial port class?

Show some data dumps.

You might also try realterm, which can show you the hexadecimal value of raw characters received. It's also easy to convert C# byte arrays into hex. Then compare both to see if characters are missing or changed or what the actual problem is.

We can't suggest any solutions until the failure is described a little better.

0

精彩评论

暂无评论...
验证码 换一张
取 消