Submit your email address to get a link for quick download on your desktop and get started!
Suppose you want to extract data. So you connected a serial device to the COM port of your computer.
However, the data you expected did not appear, even though the data acquisition software is installed on the computer.
What went wrong?
You suspect the problem is with the RS232 communication. To confirm this hypothesis, you decided to perform serial port testing. But you don’t exactly know how to do it.
To help you, we’ve created this guide that has a step-by-step explanation of how to test a serial port. It includes some preliminary checks, advanced troubleshooting methods, and additional ways to maintain smooth communication between the serial device and your computer.
During serial communication, issues such as missing data even after the serial device is connected to your computer’s COM port may surface. Conduct some basic serial port tests to identify and resolve the root causes of such issues related to RS232 communication.
Here’s how to test COM ports as basic checks:
When using a DTE instrument you may need to employ a null-modem adapter to test COM ports. You can also try to rewire the cable connector if you are feeling adventurous.
It can be challenging to determine which type of device you are handling. Documentation often skips over this information, but you may be able to deduce it from some of the device’s other signals. Modem type devices will have DSR as an output with a counter using DTR as its output. Knowing a single signal’s direction allows you to figure out the rest of them. Some manufacturers reverse the labeling of data signals for modem types of equipment, so proceed carefully.
With correctly named signals you have:
Crossing connections in this way is known as a null-modem arrangement and you may need to buy an adapter to replicate this connection to conduct your COM port test.
You should know what device connects to your computer. So, collect important data about the serial device. It will simplify the setup process and enable the device and your computer to communicate effectively.
Here’s the data type you must collect:
Note: For more details on COM port parameters, refer to the device documentation.
Download the COM Port Monitor software from their official website to test RS232. This professional RS232 tester application lets you perform COM port tests. This way, you can detect and fix COM port errors faster to enjoy smooth serial communication.
Com Port Tester captures and displays all data transmitting via the COM ports of a computer.
Once the settings are in order you can begin a new testing session by following these steps.
1. Launch Serial Port Tester
2. Choose “Session >>> New session” from the main menu. You can also use the keyboard shortcut “CTRL+N” or click “New” on the main toolbar.
3. The “New monitoring session” window will be displayed.
The checkboxes designated as “Start monitoring now” and “Start in new window” control how the new monitoring session is initiated.
Capture options: You can choose what you would like to monitor among these items - Read/Write, Create/Close, and Device Control.
Before monitoring, specify the COM port’s detail, which is connected to your computer. These parameters help you understand the data more closely.
nBaudRate: It indicates the baud rate of the serial port.
nDataLength: It represents the number of data bits per data packet.
cParity: It indicates the parity or error checking method in a serial communication.
nStopBits: It represents the number of stop bits located at the end of a dataframe.
cHandflow: It indicates the settings to control data flow (between a serial port device and a computer).
Note: Refer to your serial device’s documentation for all this information. IT will also help you understand how to check if COM port is working. Keep in mind the device settings should match Serial Port Monitor’s settings.
4. After you’ve set the options, click “Start monitoring” to initiate a new session.
5. You’ll see a new monitoring window with visualizers you’ve selected.
6. From the main menu, choose “Session >>> Save session/Save session As” to save a session.
Alternately, check the main toolbar to find “Save” and click it. Or, simply press CTRL+S keyboard shortcut to save the session.
7. If the system prompts, choose a file name for the session. This way, you can reload the session at a later time using this file and continue your work.
Once you’ve resolved issues in a serial port communication by following all the steps from 1 through 7, revert to step 1 again. This time, verify the status of the COM port lines.
COM Port Lines Status
Let’s understand what each status of the serial control lines actually means:
Based on color coding, here’s what each control line status translates to:
More complex issues may surface during a serial communication even after you’ve performed basic checks and corrected common serial port issues. As a result, the data you are expecting might not appear.
In this case, you need additional, advanced troubleshooting methods to detect the underlying issue. Let’s discuss these methods one by one:
In a loopback test, you’ll need to send data from a device and receive it back through the same COM port. This test verifies how the serial communication is working.
This test doesn’t require third-party hardware and checks:
The goal of a loopback test is to enable protocols, such as RS232, RS422, and RS485 to communicate properly:
You will need to connect additional pins, such as CTS to RTS and DTR to DSR for advanced tests using hardware flow control.
You can perform a loopback test using the HyperTerminal utility to simplify the process.
HyperTerminal converts your machine into a terminal. This offers you two advantages:
Let’s explore the step-by-step process to do a loopback test using HyperTerminal:
Set up a hardware handshake if your messages are not transmitting even after the signals are correctly wired.
Hardware handshaking assures that both sender and receiver devices are ready for data transmission, so you can control the data flow. Here’s how this works:
Note: Handshaking is not something you need to use often just because your computer supports this feature.
But if you need to use it, start by connecting handshake lines to fixed voltages. This prevents you from interfering with the operations running in the device. Also, there are resistors connected to handshake lines in many devices. So, you don’t need to tie them on your own.
In case you face these issues:
The Serial Port Tester software uses DTR/CTS handshaking.
The DTR should be kept high if no handshaking is needed. This helps connect unused inputs to your device.
If you want to disable handshaking:
Do this setting on your device.
A device sends an Xoff character to block data transmission if it’s unable to receive more data. And when the device becomes ready to accept data again, it sends the Xon character.
This is how Xon/Xoff handshaking works, and it’s a software-based data flow control.
If your device needs this type of handshaking, choose Xon/Xoff handshaking in the COM Port Tester.
It can be difficult to troubleshoot serial communication and test COM ports. But not if you follow the above instructions.
If you want to know how to check if COM port is working in a serial communication, start with preliminary checks. Gradually, use software, such as Serial Port Tester. If you still face issues in serial communication, resolve them with advanced methods, such as software and hardware handshaking and loopback tests.
Whether you’re facing issues due to handshaking protocols, port settings, or wiring, the above methods will guide you at each step. This way, your computer and the serial device can communicate and exchange data smoothly.