Two PC's Talking using COM port?

This is a discussion on Two PC's Talking using COM port? within the Windows Programming forums, part of the Platform Specific Boards category; I have a program which runs on Windows(console) and what it is used for is to program a device. The ...

  1. #1
    Registered User
    Join Date
    Oct 2002
    Posts
    24

    Two PC's Talking using COM port?

    I have a program which runs on Windows(console) and what it is used for is to program a device. The device uses programable Memory which is programmed VIA a rs232 cable.

    That software is very un-userfriendly so i want to re write the software for ease of use.

    What i am missing is the commands i need to send to the device in order to tell it what i want it to do.


    So to recap this is what i have....

    LapTop (With Software) -----RS232-------> Device

    I Have hooked up the laptop to my desktop and tryed to view the datta being sent via MSCOMM

    The laptop send data to my desktop but then it waits for me to respond befor it will send any more data.

    QUESTION:

    How can i figure out what commands the software is sending so i can rewrite my own software to send those same commands.

    Note i did not write the original software nor did i make the device. If your curious the device is a Data Aquisition System. Basicly it Aquires Data from other devices and processes it into a file. but i dont think this information is needed

  2. #2
    Registered User
    Join Date
    Jul 2002
    Posts
    34
    You need to use a "snoop" program to record all comms between the 2 devices. There are several programs on download.com proced at about $40 that do this and you will also need a 3-way rs232 cable that you can make yourself.

    If i understand you correctly, you are trying to re-write an existing third-party's software because it is not user friendly or doesnt do what you want it to, but you cant figure out what rs232 commands it is sending?

    if true, then find a snoop program (AKA "protocal anyaliser")

    Im currently writing an rs232 snoop program for a college project, but it wont be finished until december... but it will be freeware!

    joe
    #

  3. #3
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    Reverse engineering a protocol can be done, (software or hardware protocol analysers), but depending on the complexity of the controlled device, can be fraught with problems. A simple valve actuator may have a very small set of instructions, but a big PLC could have hundreds, some of which contain dynamic fields and varying lengths.

    Watching a line for hours may not catch everything. I remember well an attempt to duplicate a Westinghouse controller - worked great when started, but for some reason, was always dead the next morning. The problem was the line had always been monitored during office hours, the resulting spec had missed a midnight time sync message!

    All that having been said - it can be done. You might find the protocol is available from the original system suppliers. Sometimes when things get a bit old, it is easier to publish the protocols used and abandon support rather than try to extract support money from a small and diminishing user base.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  4. #4
    Registered User
    Join Date
    Oct 2002
    Posts
    24
    Thanx for both of your input. Its nice to know im not the only one who has ever needed to do this.
    kybert if you could could you send me your freeware snoop prog when your done so i can check it out. I will probably find something else by then but im curious to what yours offers.

  5. #5
    Registered User
    Join Date
    Jul 2002
    Posts
    34
    I reverse engineer for a living, writing applications to read codes generated by vehicle ECUs (computers in cars) -- reverse engineering can be a long winded task...

    Please note, reverse engineering is illegal in the US, but is perfectly legal in the UK...

    Q.
    Why?

    A.
    Because individual elements of a software application can be copyrighted in the US, and the protocal will be copyright. In the UK, individual elements cannot be copyrighted, only the entire software product, hence the protocal is not copyright without the rest of the software package.


    joe
    #

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. serial port to poll on request
    By infineonintern in forum C++ Programming
    Replies: 2
    Last Post: 06-11-2009, 07:52 AM
  2. FTP program
    By jakemott in forum Linux Programming
    Replies: 14
    Last Post: 10-06-2008, 02:58 PM
  3. brace-enclosed error
    By jdc18 in forum C++ Programming
    Replies: 53
    Last Post: 05-03-2007, 06:49 PM
  4. Segmentation Fault - Trying to access parallel port
    By tvsinesperanto in forum C Programming
    Replies: 3
    Last Post: 05-24-2006, 04:28 AM
  5. Basic port scanner code .. pls help ???
    By intruder in forum C Programming
    Replies: 18
    Last Post: 03-13-2003, 08:47 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21