I currently face a problem of scrambled data on one of our RS232 connections to a serial terminal and would like to request some help, if possible.
First of all some information about the setup.
We have a Windows 7 PC on which a realtime operating system is running simutaneously.
The PC itself has multiple RS232 9pin-COM Serial ports. It also has a 8-Port Serial card (Moxa) installed.
2 of the PC-Com-Ports are given to the realtime os, as well as the whole serial port card.
Previously each of the 8 serial ports on the card were used and working fine. 2 of those ports are connected to serial terminals to show data.
Now we wanted to change one of those 2 terminals to a new serial terminal (of a different manufactorer).
The PC/realtime OS side did not change in any way and the new terminal was configured correctly (9600 baud, no parity, 8 bits, 1 stopbit like the previously used terminal).
The same cable (5-10m long) is used for the connection from the serial card to the old and to the new terminal (Rx to Tx / Tx to Rx / GND to GND).
Now we face the problem, that the new terminal is getting some garbage as data (The new terminal is able to show the received data in hex).
Even though it feels some data is getting through correctly.
What we already tried:
Use one of the 9pin PC Com Ports under the realtime os: works
Use one of the 9pin PC Com Ports under windows: works
Logging the data before it is sent shows the correct data
Connect the serial card port directly to a PC Com Port under windows (Teraterm to watch): The correct data is sent
Used a RS232 sniffer between the cable end and the new terminal: The data is correctly sent
Use the serial card port under windows: Works (i had to restart the pc for this, so this will probably not count in regards to the following)
Use a another new terminal: Does not work
Use a different port on the serial terminal: Does not work
Use a different port on the serial card: Does not work
Connect the new terminal close to the serial card (new cable ~10cm long) and powered by the same power strip: Does not work
After a pc restart it started to work, but after some hours without usage it breaks again.
I feel like
a) it can't be the software, because it works on the Com ports and the data sent is correct
b) it can't be the serial card/box because it works with the old terminal and the different other connected devices on the other ports work fine
c) it can't be the new terminal, because it works with the Com ports and under windows
I'm honestly lost and would appreciate your help.
Did some new tests:
- As i said in the question above, i used a sniffer (usb-device for my laptop, which has 2 com connectors and can be placed somewhere in between) on some of the tests (were it went wrong) and the data i send via the serial card port is received correctly on the sniffer (work laptop. Thats why i believe that it can't be my software on the pc.
- Tried it completely without escape sequences (maybe the terminal has problems with some). Still the same problem, even just sending single ascii bytes.
- Created a test program, which waits for incoming data and echo's it back: I send the abc and 0-9 via a keyboard at the terminal and it is received correctly on my pc (serial card port). The data is sent correctly back (sniffer) but is again wrong on the terminal.
The strange part: The data is not always wrong (printing for example 80 "1"'s would show ~50% "1"'s and ~50% "?"'s. Some other characters have 3 different wrong characters. Here is a small excel file with the typed characters and the wrongly shown characters on the terminal:
Oh and because i forgot to add it: