How to read serial port data

If you want an in-depth analysis of how to read RS232 data from a COM port, then this article is just for you.

While serial ports have lost popularity with the introduction of USB and other high-speed data transfer technologies, serial ports are still very much in use in specialized industries and they play an integral part in networking laboratory equipment and other specialized scientific instruments.

How to read data from a serial port?

If you make use of serial devices, you need to be able to constantly monitor and observe all port activity. The information can range from event notifications, system status messages and any other messages that can help to troubleshoot should a problem arise with the hardware. The information is also a helpful tool for device installation steps.

Serial Port Reader is an easy to use tool for recording all communications to and from your serial COM ports. If you are using RS232, RS422, or RS485 COM protocols, you will be able to monitor and record all port activity.
Serial Port Monitor logo

Serial Port Monitor

Log and analyze serial port activity
4.8 Rank based on 41+ users, Reviews(75)
Download 14-day fully-functional trial period
Serial Port Monitor

What do you need to read data from an RS232 serial port?

  1. Launch Serial Port Reader and select “Session -> New Session” from the Session menu option. You can also click Ctrl+N. New session
  2. A list of view options is displayed in the “New monitoring session” window. Choose the views that suit your requirements. Start new session

    Table view - show all the I/O request packets (IRPs) in a simple table view

    Use Line view to display a detailed list of all requests passed through a particular serial line

    Dump view – shows data passed through the serial line

    Terminal view - display all data in a text console in ASCII characters

    Modbus view displays all data sent and received using Modbus Protocol with RTU (Remote Terminal Unit) mode or ASCII option

    You are not limited to one view, you can “Select All” to choose all the available options
    Use the “Select none” button to deselect and reset all previous selections.

  3. Click the “Start monitoring now” or “Start in new window” checkbox in the “New session options” section of the window. Reading data from serial port
  4. Capture options allow you to choose which events you want to record. The options are Create/Close, Read/Write, and Device Control. You can click one or all of the options.

  5. To start monitoring, click the “Start monitoring” button. A new monitoring window with all the various views selected in step 2 will be displayed.

  6. You would want to save your session so that you can refer to the logs and analyze the recorded data. To save your session, select Session -> Save session / Save session as ... from the main menu. There is also a “Save” icon on the toolbar, or simply press Ctrl + S to save your session. Reading data from serial port

The understanding of serial protocol

In order to read and analyze serial port data, there are a number of terms and concepts that you should be familiar with around the RS232 protocol. From understanding electrical voltages to pinouts, having this knowledge will make reading serial data from a com port and analyzing all the monitored data that much more meaningful.

Baud Rate

Baud rate is a measure of data transmission speed over a serial line. It is measured in bits per second (bps). Baud rates between 110 to 230400 are supported by the RS232 protocol. A higher Baud rate means the data is transmitted faster, however, the baud rate at the sending and receiving end of a circuit needs to be the same.

Voltage Levels

Line voltage is defined as the voltage between any two lines in a circuit. This is known as signal and control voltages (CV). Control voltage is a direct current (DC) electrical signal that manipulates the values of components in analog circuits.

RS232 Voltage Levels

Voltages in an RS232 serial port are often referred to as bipolar – where they are negative or positive in relation to the ground. Signals range from -25V to +25V.

A logic high (1) represents a negative voltage between -3 and -25V, whereas a logic low (0) transmits a positive voltage in a +3V to +25V range. A voltage between -3V and +3V falls into what is known as an indeterminate region.

Line Impedance

The impedance of a line is the measure of its inductance and its capacitance per unit length. Capacitance describes how well the line can store an electric charge, while inductance is the property whereby an electromotive force is generated when there is a change in current through the circuit.

Impedance bridging is when the load impedance between the source and receiver is different, with the receiver's load impedance being much higher. In the case of RS232 protocol – the range is 3KΩ to 7KΩ and this serves the purpose of maximizing the voltage transfer between the RS232 port and the receiver.

Mode of Operation

There are two types of signal inputs – differential and single-ended. Single-ended signaling is a simple and common means of transmitting an electrical signal from a sender to a receiver and RS232 makes use of this input. Single-ended signaling involves two wires. One wire carries the actual signal, while the other is connected to a reference voltage that ensures a constant output voltage.

Slew Rate

Slew Rate (SR) is the change of voltage per unit of time. In RS232 this is the time it takes for the RS232 driver to respond to this change. In order to prevent any interference or cross-talk while transmitting signals, the RS232 protocol sets out a maximum slew rate at 30V/µsec and a minimum slew rate that has slow variance times. This ensures a minimal amount of interference or cross-talk while a signal is transmitted.

RS232 Pinout

An RS232 connection between a Data Terminal Equipment (DTE) and a Data Communications Equipment (DCE) requires the use of DB9 or DB25 connectors. The DTE is the male port, while the DCE is typically female. As their namesake, a DB9 connector has 9 pins, while a DB25 has 25 pins. Each pin in the connectors has a determined purpose.

DB9 pinout

The RS232 serial interface has nine pins and can be obtained in male or female type configurations. RS232C is an upgraded version of RS233 and it's exactly the same with the only exception that it makes use of a 25 pin connector. Irrespective of whether the connector is 9 or 25 pins, only 3 of those pins are actually used when connecting a terminal device.

DB25 pinout

Apart from defining electrical characteristics, each signal in RS232 data transmission has a specific function that is determined by the RS232 protocol. These functions include control and timing signals, common ground, and data signals. Refer to the image below that illustrates the signals and functions that make up the RS232 pinout.

Serial signal functions

RS232 also includes a number of complementary secondary signals that can be applied when configuring DCE and DTE connections. These signals include TxD (Transmit Data), RxD((Receive Data), DTE (Data Terminal Equipment), RTS (Request To Send), and DCD (Data Carrier Detect).

small logo Serial Port Monitor
#1 at Serial Port Software
Serial Port Monitor
Log and analyze serial port activity
4.6 rank based on 75 + users
Get a download link for your desktop
Submit your email address to get a link for quick download on your desktop and get started!
or