
But which tool is better suited for the job an RS232 analyzer or a serial port spy? Although both tools are extremely useful and allow you to debug RS232 data flows, they utilize different methods to accomplish this and each has its pros and cons. This article describes both approaches to help you pick the best tool for your situation.
This setup gives you a byte level analysis of what is physically occurring on the serial link. The RS232 analyzer records and time stamps the data, changes to the signal lines, and line status errors while the transmission is occurring. Since the data is being collected at the byte level you are able to inspect the inter character timing between events exactly as they were recorded on the line.
The benefit to this approach is that you can view exactly how the data was transmitted on the RS232 line along with the timings between events. An RS232 analyzer is the tool you want to use when you are in a situation where you need to prove who sent what. You can also analyze a link between any two RS232 devices including two embedded systems. The drawback is that you need to break your RS232 link to insert the cable which can be difficult if you are working with a remote user in the field.
The benefit to this approach is that it is usually easier to configure and use. It also allows you to see things internal to the operating system that an RS232 line analyzer cannot such as calls to open and close the serial port handle, the process id of the program using the serial port, and the baud rate being used. It also allows you to debug a link in situations where physically tapping into the serial line is impossible such as internal modems or devices that connect to the PC via USB and utilize internal USB–RS232 converters.
The drawback is that a serial port spy is limited to displaying only what a program reads or writes to the API. If for some reason your program decided to stop making read requests it might look like the remote device stopped transmitting when in reality the Windows program stopped listening. It also requires that one of the devices in your link be a Windows PC. You can’t debug two microcontrollers with this type of tool.
In general an RS232 analyzer is better suited to tackle a wider range of problems since it displays what physically happens on the serial link but the convenience of a serial spy and its ability to give you a logical view of how your program is interacting with the Windows API is very beneficial to engineers who develop serial applications under Windows.