ro-E
ro-E

Reputation: 299

can't read from SerialPort

I'm trying to read a message via serial port (plugged in a RS-422 to my computer by USB)

The problem is that i have 2 cables of this type.

One is a USB straight to 422 and the other one is a usb-RS-232 cable with a RS-232 to RS-422 adapter.

I've installed all the drivers. I write the line: m_Pod.read(response, 0, 1000); where m_Pod is the SerialPort object and response in the byte[] to save the message read.

This line is in an event that if data is received, so I read the message.

The first connector works fine, and I read the message when the event occurs. The second connector, however, doesn't work. The event doesn't occur. If I try to read the message manually, I get a random number (63), instead of the long message I'm supposed to.

This is a picture of the second adapter: http://oi50.tinypic.com/34nh4kz.jpg

On the right is the USB to RS-232 and on the left is the RS-232 to RS-422.

Upvotes: 1

Views: 1478

Answers (1)

Michał Mocarski
Michał Mocarski

Reputation: 11

Have you tried playing with Handshake property? http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.handshake.aspx Depending on what signals your adapter is using/providing you might need to select from software/hardware handshaking.

Upvotes: 1

Related Questions