Solved! [RS-232] Garbage Read when using USB to RS-232 adapter vs. normal RS-232 Port

Status
Not open for further replies.

Hollabackatcha

Prominent
Mar 8, 2017
2
0
510
Hello,

I have been using a program that I created in C++ to control test equipment using the RS-232 interface. The computer running this program is a Windows XP laptop with a physical RS-232 port on the back. I recently tried to make the move to a Windows 7 laptop without a physical RS-232 port by using several USB to RS-232 adapters. Each one can write successfully, but reads garbage values (zeros). I did not change the affected code when I moved from one PC to the other and I didn't change the serial settings. Can someone explain why moving from a physical RS-232 port to an emulated one can cause this problem? Thanks.

Serial Device Specs:
Baud Rate: 115.2k Hz
Data Bits: 8
Stop Bits: 1
Parity: None
Flow Control: None
Terminator: Carriage Return Line Feed
 
Solution
Probably a matter of the USB to RS-232 pinouts.

Although there are standard configurations many manufacturers created proprietary cables/adapters for their own purposes. Mostly to sell their own products.

Good chance that there is some unique USB to RS-232 connection requirement: physical or virtual.

Google USB to RS-232 pinouts. Start by looking at images. Especially wiring diagrams. See if you can match up the physical configurations to the connectivity required by your application.

Full disclosure: Not sure how much you can really do with C++ with respect to the desired emulation.

But the first step is to verify the requirement for both write and read connectivity.



Probably a matter of the USB to RS-232 pinouts.

Although there are standard configurations many manufacturers created proprietary cables/adapters for their own purposes. Mostly to sell their own products.

Good chance that there is some unique USB to RS-232 connection requirement: physical or virtual.

Google USB to RS-232 pinouts. Start by looking at images. Especially wiring diagrams. See if you can match up the physical configurations to the connectivity required by your application.

Full disclosure: Not sure how much you can really do with C++ with respect to the desired emulation.

But the first step is to verify the requirement for both write and read connectivity.



 
Solution
You have made (at least) two changes:
- replaced serial hardware (RS-232 with USB adapter)
- replaced actual hardware (snail-slow ten-year old laptop with modern desktop)
- replaced OS (XP with 7/10)

If said remote device can operate using standard serial terminal, try first talking to it using eg Putty. Your custom software could not set up properly the port, or rely on timeouts which do not work properly on USB ports
 

daamii

Prominent
Feb 13, 2017
1
0
510
What if you add more delay in your code (wait for answer) and change the buffer ?
Make sure that the adapter is properly installed (proper drivers). I use these kind of adapters and they work fine.
 
Status
Not open for further replies.