Introduction: RS232 Serial Spy
I will start by explaining my motivation for making this device, I am an automation engineer and recently was asked to develop a SCADA system as a replacement for an end of life system that is still in use. The PLC in the network only has a single RS232 output which is connected to the existing SCADA. As the PLC system is old and the structure of the program is not 100% clear due to lack of documentation, it was desirable to hook up the new SCADA in parallel with the existing system as a monitor for verification prior to taking full control of the process.
The problem arises that RS232 is a point to point protocol, this means that there can only be one device on each end of the cable, for further nodes in the network, you must have multiple serial ports and a device capable of mapping the data onwards.
The RS232 spy shown here allows a second device to be introduced as an RS232 monitor (no ability to write to the device), perfect for my application.
Step 1: Getting Started
WHAT YOU WILL NEED:
- 1 junction box
- 1 male D-SUB 9 connector
- 2 female D-SUB 9 connectors
- 1 2.2k OHM resistor (colour code red, red, red)
- 1 diode 1N4148
- Assorted wire
- Soldering Iron
- Wire Snips
Step 2: Mounting the Connectors
I like for the D-SUB connectors to be fitted nicely into my creations, for this I keep the housing from an old connector to hand, I use this as a template for marking the cutout.
I start by laying the connector down and drilling out the 2 mounting screw holes.
I then bolt the housing in place and colour in the inside with a sharpie.
I remove the housing and repeat for each of the required connectors, I then remove the template and carefully expand the marking depending on the type of connector going in.
If the connector is to be female, I make the opening a little larger, this is because the male connector has a screen that comes around the outside of the female connector, the larger opening stops the backing material from holding the connector out.
Using a drill I remove as much material as possible and finish the edge by hand with a small file.
Step 3: Wiring
Using the wiring diagram above we can create a straight through connection to interrupt the cable but maintain comms with the main computer.
However, tapping off the TX line from the slave (PLC in this case) we can create a monitor output as well. We use a diode and a resistor to protect the comms network from crosstalk (no more than one master) and the resistor protects against an excessive load.
Step 4: Test
I have tested this device and the monitor machine can see data coming from the PLC to the master SCADA system, the new system cannot send data to the PLC as the setup described is Half-Duplex (one-way comms). Also, the new (monitor) SCADA system does not take part in a handshake with the PLC so without the master, no comms will initiate.
Be sure to mark the com and the monitor as connection to the wrong ports will prevent proper operation of your devices.
We have a be nice policy.
Please be positive and constructive.