Author Topic: How to figure out the RS232 input/output required  (Read 2032 times)

0 Members and 1 Guest are viewing this topic.

Offline Solder FumesTopic starter

  • Newbie
  • Posts: 6
  • Country: au
How to figure out the RS232 input/output required
« on: June 29, 2016, 09:13:35 am »
Hi,

I am wanting to make a hardware interface to some obscure/antique software that uses RS232 for the input and perhaps also for some output. The software requires a hardware controller with 10 switches. The hardware controller is unobtanium and the author of the software is difficult/impossible to locate.

Short of disassembling the program is there any easy way to understand what is required by the software?

I am thinking that perhaps I can use another PC as a terminal. Then I can try all combinations of baud rate and parity to see if anything works. Ideally I would like to also send all possible commands to the RS232 to see if anything happens in the software.

Helpfully the software has a RS232 "debug" screen which shows live information on:
CRC Errors
Bad Packets
Bad Bytes
Packet Numbers
(also pls see the attached image of the "debug" screen.

Hope someone can offer some guidance....

Thanks from,
H.
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: How to figure out the RS232 input/output required
« Reply #1 on: June 29, 2016, 09:31:54 am »
A simple logic analyzer would take care of data capture, an example -

http://www.ebay.com/itm/24MHz-8-Channel-USB-Logic-Analyzer-8-CH-Logic-Analyzer-for-Arduino-MCU-/142017327036?hash=item2110e46fbc:g:FEUAAOSwQupXVjOq

Just search ebay on "Logic Analyzer"

They use Saleae software, https://www.saleae.com/downloads


Regards, Dana.
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 
The following users thanked this post: Solder Fumes

Offline TomS_

  • Frequent Contributor
  • **
  • Posts: 834
  • Country: gb
Re: How to figure out the RS232 input/output required
« Reply #2 on: June 29, 2016, 09:39:27 am »
RS232 doesnt use packets, so forget about that. Any packetising of data will be implemented by the software running on either side of the link.

CRC errors and bad bytes equally will need to be handled by the software either side.

Its really just a bit banging system. Feed a byte to a driver and it bangs it out as different voltage levels.

If you still have access to the two devices that are communicating then there is a method you can try to reverse engineer the "protocol" used between the units, allowing you to rebuild existing units or build new units as replacements or upgrades:

1. connect a PC with terminal software (e.g. PuTTY) to the controller and determine the baud rate. As you make changes to settings, or request readings, you will see said requests appear in the terminal software on the PC in some form, maybe simply as binary blobs or text based commands (e.g. AT commands when talking to a modem). It really depends on how the protocol is implemented.

2. connect the PC to the remote unit and issue the same commands and see what is returned

By doing this you learn what is done by the controller to make the other unit act or respond, and what should be sent back in response - if anything.

Without original source, or reference manuals to detail anything, this is about all you can do - short of disassembly. It could be a very long and arduous process depending on the complexity, or it may be very simple.
 
The following users thanked this post: Solder Fumes

Offline Solder FumesTopic starter

  • Newbie
  • Posts: 6
  • Country: au
Re: How to figure out the RS232 input/output required
« Reply #3 on: June 29, 2016, 11:39:06 am »
Thanks very much danadak and TomS for those very helpful replies. I will give those suggestions a try. Thanks for taking the time to give me those tips!

Unfortunately I only have the software and not the external hardware controller (control device) so I can't eavesdrop on the communications.

I wonder if there is some sort of automated "probing" type terminal software that has been used by others. For example sending all possible commands over RS232 and monitoring the responses....

I will keep you updated!
 

Offline daniel4422

  • Newbie
  • Posts: 4
  • Country: il
Re: How to figure out the RS232 input/output required
« Reply #4 on: June 29, 2016, 11:44:35 am »
On windows XP there is a software called - "HyperTerminal", which you can connect an RS-232 cable to the computer serial port and echo the incoming/outgoing data.
maybe you can try this one ...
 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2328
  • Country: 00
Re: How to figure out the RS232 input/output required
« Reply #5 on: June 29, 2016, 11:47:00 am »
Your pc can help on this use 2 comm port's and a reverse cable, but is like to decrypt a message a lot of stuff is on the software stack , and normally is a kind of state machine with a lot of IF then case situations, but is not rare to see plain ascII commands. good look
 

Offline StuUK

  • Frequent Contributor
  • **
  • Posts: 390
  • Country: gb
Re: How to figure out the RS232 input/output required
« Reply #6 on: June 29, 2016, 12:03:48 pm »
Thanks very much danadak and TomS for those very helpful replies. I will give those suggestions a try. Thanks for taking the time to give me those tips!

Unfortunately I only have the software and not the external hardware controller (control device) so I can't eavesdrop on the communications.

I wonder if there is some sort of automated "probing" type terminal software that has been used by others. For example sending all possible commands over RS232 and monitoring the responses....

I will keep you updated!

Do you know what the possible commands are? There is no concept of commands simply bytes of data passing back and forth which the two systems communicating determine what to do with....
 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2328
  • Country: 00
Re: How to figure out the RS232 input/output required
« Reply #7 on: June 29, 2016, 12:15:58 pm »
1ST) You need to know your enemy

What this board does ?

What information you have on this board or similar competitor product ?

Is any industry standard on   the "soup"

How is the PC software ( a lot of information may be on the software )

Do they have some config / debug files ?
 

Offline TomS_

  • Frequent Contributor
  • **
  • Posts: 834
  • Country: gb
Re: How to figure out the RS232 input/output required
« Reply #8 on: June 29, 2016, 03:58:04 pm »
There is no concept of commands simply bytes of data passing back and forth which the two systems communicating determine what to do with....

Precisely.

RS232 sits at layer 1 of the OSI model. It defines a physical interface that allows two systems to be connected with each other. Thats all.

Anything beyond that, like commands and data structures, are determined by the software that runs on the two halves of the system.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf