I have some industrial equipment I'm trying to reverse-engineer. It communicates from the main CPU to a controller via a serial connection. I want to hook into the serial connection and dump everything doing down that line to log file so that I can stare at the messages and try to figure out the protocol.
I could just plug the serial cable into my computer but I need the messages to continue going to the controller or else the rest of the system will error. So basically I need to tap into it.
My first thought is to use a laptop with two USB-Serial adapters. I could use a perl script to open both serial connections as files and send everything that comes in the one serial connection right back out the other serial connection, but also dump it to a log file. Will this even work? I can see that it will introduce some latency but I don't think that will be critical.