Skip to content

Application Note: Establishing Serial Communication with Instruments Using a Terminal Program

Overview

This application note provides an in-depth guide for establishing serial communication between a computer and instruments, focusing on configuring serial terminal programs for interfacing with equipment. Serial communication is a vital method in many fields, including geophysics, laboratory work, and industrial systems, where instruments often rely on RS232 or RS485 protocols for control and data exchange. This document will explore serial communication fundamentals, RS232 and RS485 standards, USB-to-serial adapters, and provide step-by-step instructions on using a serial terminal program for instrument interfacing.

Serial Communication Basics

Serial communication is a method of transmitting data between devices one bit at a time over a single channel, typically over a wired connection. In contrast to parallel communication, where multiple bits are transmitted simultaneously, serial communication minimizes the number of data lines, reducing the number of conductors required.

Serial communication is widely used for:

  • Device configuration: Sending commands to configure instruments and control systems.
  • Data acquisition: Logging real-time data from sensors and other equipment.

Key aspects of serial communication include:

  • Baud rate: The speed of data transmission, measured in bits per second (bps).
  • Data bits: The number of bits in each data packet, typically 7 or 8 bits.
  • Stop bits: Bits marking the end of each data packet.
  • Parity bit: Used for basic error detection, though often disabled.

The most common serial protocols are RS232 and RS485, each suited to different use cases, which we will explore in detail below.

RS232 vs. RS485

RS232

RS232 is one of the most commonly used serial communication protocols. It employs single-ended signaling, meaning that it transmits and receives data over individual lines with respect to a common ground. RS232 typically uses DB9 connectors and supports point-to-point communication over relatively short distances (up to 50 feet) at moderate data rates.

RS232 is often used in laboratory and field instruments, such as data loggers, environmental sensors, and programmable logic controllers (PLCs), where direct, short-range communication between a computer and a device is required.

RS485

RS485 is a more robust and versatile protocol compared to RS232, primarily because it supports differential signaling and can operate in half-duplex or full-duplex modes depending on the configuration and number of conductors allowed by the application. RS485 is capable of supporting long-distance communication over a kilometer or more and multi-device networks. Due to these characteristics, RS485 is widely used in industrial automation, process control, and instrumentation systems where multiple devices must communicate over a single bus.

RS485’s differential signaling makes it resistant to noise and interference, making it ideal for noisy environments or extended cable runs.

Why Use USB-to-Serial Adapters?

As most modern computers, particularly laptops, no longer come with RS232 or RS485 ports. USB-to-serial adapters are required to establish communication with instruments that utilize these protocols. These adapters convert USB signals from the computer to the necessary RS232 or RS485 signals, allowing seamless integration.

Most USB-to-serial adapters rely on chipsets, such as FTDI or Prolific, which provide reliable data transmission and driver support for various operating systems. It is critical to install the appropriate drivers for your operating system to ensure that the adapter is recognized by your computer.

Setting Up Serial Communication Using CoolTerm

CoolTerm is a widely-used, free terminal program for serial communication. It is suitable for configuring and communicating with instruments that utilize serial protocols like RS232 or RS485. While there are other terminal programs available, we find CoolTerm to be the easiest to use for the beginner. The following steps outline the process for establishing communication between your computer and an instrument using CoolTerm.

Step 1: Install CoolTerm

Download CoolTerm and install it on your computer. CoolTerm is available for Windows, macOS, and Linux operating systems. Read the README document and follow its directions for a successful installation.

Step 2: Identify Your Device

Before connecting the instrument, launch CoolTerm and go to Connection → Options → Port. Note the available serial ports listed on the system. Now, connect your instrument to your computer using a serial-to-USB adapter (if required), and click Rescan Serial Ports. The newly listed port corresponds to your instrument.

Step 3: Configure Serial Settings

Before initiating the connection, it is crucial to configure the serial communication settings to match the parameters of your instrument. These settings include:

  • Baud Rate: The data transmission rate, specified in bits per second (bps). Common baud rates include 9600, 19200, and 115200 bps. Always refer to the instrument’s manual for the correct baud rate. Trail and error can be used as well.
  • Data Bits: Typically set to 8.
  • Stop Bits: Commonly set to 1.
  • Parity: Usually set to None, but check the instrument’s documentation for details.

In CoolTerm, these settings can be adjusted under Connection → Options → Serial Port Settings.

Step 4: Enable Useful Features

To make communication easier, you may want to enable certain features in CoolTerm, such as:

  • Line Mode: Found under Connection → Options → Terminal, this mode allows you to type and edit commands before sending them, which can help avoid errors.
  • Tab Handling: In cases where data is tab-separated, adjust how tab characters are displayed under Connection → Options → Data Handling to avoid confusion with decimal points or other characters.

Step 5: Connect and Send Commands

Once the settings are configured, press OK and click Connect at the top of the window. If the connection is successful, the status at the bottom of the screen will change from "Disconnected" to "Connected."

You are now ready to send commands to the instrument. The specific commands will vary by device and are detailed in the instrument’s user manual. For example, you may issue a command like READ to request data or SET to configure the instrument.

Step 6: Troubleshooting

If the instrument does not respond, verify that:

  • The baud rate and other communication settings match those of the instrument.
  • The correct port has been selected.
  • The USB-to-serial adapter driver is properly installed.

Understanding Baud Rate and Other Serial Parameters

Baud Rate

The baud rate defines the speed of communication between the computer and the instrument, expressed in bits per second (bps). Common baud rates include 9600, 19200, and 115200 bps. For successful communication, both the computer and the instrument must use the same baud rate. A mismatch will result in data transmission errors.

Data Bits, Stop Bits, and Parity

  • Data Bits: Most serial communication uses 8 data bits, which is the number of bits in each transmitted data packet.
  • Stop Bits: These indicate the end of a data packet. The most common setting is 1 stop bit, although 2 stop bits can be used for slower, more reliable communication.
  • Parity: Parity bits are used for basic error-checking. In many modern setups, parity is None or disabled, but some systems use Even or Odd parity for added integrity checks.

Conclusion

Serial communication remains a critical component of controlling and configuring instruments in both laboratory and field settings. By using a terminal program like CoolTerm, engineers, technicians, and scientists can easily interface with instruments, send commands, and log data over RS232 or RS485 connections. Understanding key parameters like baud rate, stop bits, and parity ensures successful and reliable communication with your equipment.

For further assistance with serial communication, feel free to contact our technical support team.