Serial ports are used to connect computers with many types of scientific and industrial devices. Using a machine’s COM port you can capture the data transmission and display it in spreadsheets, databases, and other types of analysis software.
Monitoring and analyzing serial communication requires the use of a serial data logger. This specialized software reads and displays RS232 data and can save it to a file so it can be analyzed at a later time.
You need serial data logger software which can interact with a computer’s COM ports to collect the transmitted data. The best choice in this kind of software is Serial Port Logger. It offers a fast and easy method of displaying serial port activity and recording it to a file.
In this article, we will look at how to use COM Port Logger to monitor and log your serial port data.
Table of contents:
COM port logger settings
COM Port Number
The COM port that will be used by the RS232 data logger needs to be specified. Your computer may have more than one COM port. It might also not have any serial interfaces. If that is the case, you can add more using hardware converters, software or software solutions depending on the communication options available on the computer. Select a converter that works with your machine whether through the Ethernet, Bluetooth or USB. For information on using USB converters check out Tips on Using USB-to-Serial Converters.
Data transmission through COM ports employs serial communications where messages are sent one bit at a time in a sequential manner. The baud rate describes the maximum speed of data transmission. Both the COM device and the computer must use the same baud rate to enact serial communication. Select the baud rate that conforms to your device when setting the parameter in the data logger software application. A faster baud rate reduces the time required to send and receive messages, and you should select a high value if your device offers that option. If you are connecting over long distances or you find the communication is unreliable, you may need to lower the baud rate.
Regardless of the connection speed, the RS232 port logger will determine how fast you can capture information about the transmission.
A serial port receives data one bit at a time but processes it in groups of seven or eight bits. It’s critical when using a serial port data logger that the software and device group the received data in the same way. The device’s user manual should indicate the number of data bits that it uses. When in doubt, use eight data bits in the RS232 logger as this is the more commonly used setting.
Parity defines whenever an entity is odd or even. It can be used for error checking in serial communication. When parity checking is enforced, the number of 1’s in a group of data bits being sent is counted. The device or computer determines if there is an odd or even number of 1’s and sets the parity bit based on that information. When the data is received the same procedure is used to verify if the value of the Parity Bit agrees with the one which was sent.
A parity check implies that the computer and serial device use the same method when calculating the value of the Parity Bit. Parity can be set to on for either an odd or even number of 1’s in the transmission. Both sides of the checking equation must set the value in the same way. Using Even Parity sets the Parity Bit to one when an even number of 1’s are involved, with an Odd Parity value of one indicating an odd number of 1’s have been sent.
Parity checking provides a basic and limited form of error checking. While it will alert you to an error of a single bit, this type of error checking will not help if two bits were affected. No information concerning which bit is in error is supplied. There are other error checking techniques such as cyclic redundancy checks or employing the Start and Stop bits.
Parity can be set to “None” and should be done so in the COM port logger if you cannot determine the parity settings of the device.
Start and Stop Bits
Asynchronous communication is used in RS232 ports, meaning that data transmissions are sporadic and are not constrained by set time intervals. This requires that a device has the capability to identify the start and end of a message. Start and Stop bits are used for this purpose. The Start Bit is sent before any of the data bits and the Stop Bit is appended after the data bits or the Parity Bit if it is in use.
Data lines can be in the on or off state. Idle lines are considered to be on. The line is set to off by an instrument or computer when it is preparing to send data. This is the Start Bit and is immediately followed by the data bits that comprise the message.
The Stop Bit is used to enable a computer and device to sync with each other if an error, such as noise on the line, interrupts the transmission. The baud rate and the number of data and parity bits are used to calculate the time interval between the Start and Stop Bits. Stop Bits are always on, so if an off value is detected at the receiving end it indicates that an error has been encountered.
Though the term Stop Bit is used, the entity is not a physical bit. It is a value that indicates the minimum length of time a line must be on when data transmission is complete. On PCs it is usually either 1 or 2 bits which is specified in the driver parameters. The most commonly used value is 1 and your message may be slower when using a value of 2. If the number of data bits is less than 7 you may see a Stop Bit of 1.5. ASCII characters cannot be transmitted with 7 bits so this setting is rarely used.
Flow Control (Handshaking)
When you first connect a device to a computer you should try it without using flow control. Flow control may be needed if you find the device is missing parts of messages which can cause it to fail or work incorrectly.
If you need to implement flow control it will most often be an Xon \ Xoff (software) selection. You can learn more about handshaking in our manual of testing Serial port
RS232 data logger software:
A step-by-step guide
Once you have configured the settings in the software you can start using Serial Port Logger to collect data from your system’s COM ports. Follow these steps to start monitoring serial data:
1. Download, install and launch Serial Data Logger.
2. Choose “Session >>> New session” from the main menu, use the CTRL+N shortcut or click “New” on the main toolbar.
3. The “New monitoring session” window will be displayed:
Select how you want to view your data using the visualizers that will be employed during the session.
- Line view displays detailed information about the data transmitted through a specific serial line.
- Terminal view displays the data as ASCII characters in a text console.
- Table view displays recorded IRPs in a table format.
- Dump view displays all of the sent and received data passed through the serial line.
- Modbus view displays received and sent Modbus data (RTU and ASCII).
By using the “Start monitoring now” and “Start in new window” checkboxes you can control the characteristics of a new monitoring session.
Capture options allow you to determine which events you wish to monitor from these choices: Create/Close, Read/Write or Device Control.
4. Click “Start monitoring” to start the new monitoring session after selecting the settings.
A new monitoring window will be opened by the RS232 logger, displaying the data using the previously selected visualizers.
5. Save a session by choosing “Session >>> Save session/Save session As” from the main menu. You can also or click “Save” on the main toolbar, or press the CTRL+S keyboard shortcut.
RS232 Data Logger is a professional utility that enables you to easily monitor and save serial communication data for immediate use or later analysis. Its settings are fully customizable, allowing you to use the application with any serial device or interface. Its a great tool for individuals who work with serial devices or applications.