0
\$\begingroup\$

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.

Sent:

enter image description here

Received:

enter image description here

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:

https://imgur.com/a/mOaIC5N

Oh and because i forgot to add it:

\$\endgroup\$
  • \$\begingroup\$ What is the name of the real-time OS? \$\endgroup\$ – relayman357 Nov 2 at 17:42
  • \$\begingroup\$ The fact the problem appears after period of not using makes me think it may be port driver problem. “...after some hours without usage”. Wonder if it is a power saving setting kind of problem. \$\endgroup\$ – relayman357 Nov 2 at 17:49
  • \$\begingroup\$ Try setting 2 stop bits at the transmitter. If that doesn’t work see if the parity is set identically on both ends. It would help a lot if both data pictures were synchronised to begin at 47 44 1B 3D instead of them being pictures at different points in time. \$\endgroup\$ – Andy aka Nov 2 at 17:53
  • 1
    \$\begingroup\$ Also, the term “scrambled data” is incorrect to use here. \$\endgroup\$ – Andy aka Nov 2 at 18:00
  • \$\begingroup\$ Since it works after a reboot until it has been left fallow for a few hours, the problem is either electronic (in the driver at one end or the receiver at the other end) or else there is something in the operating system and/or application program changing. Leaving async "fallow" is the same as a very very long "stop bit" and actually helps removes any possible confusion, should there every had been any, in a working receiver. New communications should re-start the synchronization. Incorrect start/stop/data configs should be a problem right away. So that cannot be it. \$\endgroup\$ – jonk Nov 3 at 5:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.