Hyperterminal To Test Serial Port

Posted By admin On 18/04/19

In this article, we'll tell you about the simplest way to test serial applications with the help of a virtual serial port. By using a dedicated software, you can provide your system with as many virtual COM interfaces as you need. Continue reading to better understand the benefits of serial port simulation for serial app development and testing. To find out how to split serial port between application look at out new tutorial with examples of using Virtual COM Port Driver PRO.

Using PuTTY for serial COM connections (HyperTerminal replacement) If you’re looking for a free and solid application to use for your serial COM connections, try PuTTY. It’s free for commercial and private use, and takes up a mere 444KB of disk space. Follow the steps below to connect Sophos Firewall using the serial cable: Physically connect one end of the RJ45-DB9 cable to the Console Port on your Sophos XG Firewall and the other end to the PC's serial port. Launch HyperTerminal: If configuring for the first time, set the location information and click OK. Dec 18, 2017 - It can show problems in the serial port, the cable, or the software generating the messages. Performing a Loopback Test in Hyperterminal.

Contents

How to test serial applications


Serial communication is an integral part of a production environment where numerous specialized devices exchange data via serial interfaces. It often happens that to receive data from a particular device, specialists need to use dedicated serial applications. As a rule, such serial apps communicate with required hardware via COM interfaces which in turn are linked with a serial cable. Once connected, serial programs can get particular data from industrial equipment, process it, and store it in a single database. Later, the data will be used for making reports, creating various GUI objects, generating graphs, etc.

While developing serial apps, programmers may face some difficulties related to program testing. In some cases, it's not possible to modify the hardware device. Therefore, if it's required to test a certain application for a special occurrence of characters, experts start looking for solutions.

One of the possible workarounds is using a null modem cable, which allows connecting one program, e.g. HyperTerminal, to another. With this type of connection, you can not only link two computers together but also provide communication between two apps installed on the same PC. For this to be accomplished, you need to have at least two COM ports available in your system.

If your PC lacks serial interfaces, you may create virtual COM ports and use them as emulators of physical serial ports. In this article, you'll find out how to establish serial communication using a virtual COM port.

Null modem: definition and use


A null modem connection is a common method of communication. This type of connection is possible when two COM ports are linked with the help of a null modem cable. A crossed-over RS-232 cable used in the null modem communication acts as a DCE between DTE devices (applications) that need to talk. The cable helps swap serial signals such as TD-RD, DTR-DSR, etc., which means any serial device (application) gets the ability to send and receive data from another one over a null modem channel. Learn more about null modem pinout and wiring.

The required equipment (or applications working with COM ports) can be connected either by a physical serial cable or virtual null-modem solution. Using the latter one seems to be more efficient, considering that virtual null modem cable is not limited by the distance and lets you create an unlimited number of virtual connections at a time.

COM port emulator software


This time we've decided to establish communication via a virtual null modem cable. As is known, there are many port virtualization apps out there. We've chosen a solution that stands out for its stability and ease of use. Virtual COM Port Driver is a serial port emulator for Windows. The software supports Windows kernel driver technology (WDM, WMI, Power Management, PnP, etc.) and is fully compatible with most of recent Windows versions (including Windows 10 and Windows Server 2016). The software allows creating pairs of virtual serial ports connected via a virtual null-modem cable.

This comes in handy when you need to exchange data between serial apps. You can just connect apps to a pair of COM ports and communicate data in such a way that everything written to one virtual port will immediately appear on the other end of the pair and vice versa.

Serial port emulation for testing environment


Now let's see how to install a pair of virtual serial interfaces on your system.

Hyperterminal To Test Serial Port
  1. Download Virtual Serial Port Driver and install it on your computer.
  2. Start the program and open the “Manage ports” window. There you'll see the 'Add pair' option. Now, you can either select the virtual serial ports from the dropdown list or specify them manually.
    What is especially convenient is that you can assign any custom names to the ports you create with Virtual Serial Port Driver (except for those port names already used in your system). Just make sure that the apps that will work with these COM ports support the port names you've chosen.

  3. Click 'Add pair' and that's it. The number of virtual COM port pairs you can create with the software is not limited.

Please keep in mind that if you're going to use the newly-created virtual ports with C# Windows application, you need to name them starting with COM. It's very important as the .NET Framework uses the System.IO.Ports to access the COM ports. To establish a connection we need to use a function named as serialPort1.Open() but it can only open a port which name starts with COM.

In case you need to test serial ports with some other app, in “The Basic Principles of Serial Port Emulation” you’ll find the examples of using Virtual Serial Port Driver with different programming languages.

How to test a serial port with HyperTerminal


Once your virtual COM interfaces have been properly set up, you can start testing. As an example, we’ll consider testing COM ports with Windows HyperTerminal.

To launch a new HyperTerminal instance, head to Windows Start Menu > Programs > Accessories > Communication > HyperTerminal.

Say, you have a pair of virtual ports named COM3 and COM4. Here’s what you need to do:

  1. First,create a connection to COM3 port.
  2. After that, open the File Menu and select 'New Connection'. Enter a name, e.g. Test_COM3, choose the icon, and hit OK.
  3. Now, find COM3 in the dropdown list and press OK. Make sure the properties are kept default and press OK.
  4. Next step is creating a connection to the other port - COM4.
  5. To do this, open the File Menu > New Connection. Enter a name, say Test_COM4, choose the icon, and press OK. Choose COM4 from the dropdown list and hit OK. Keep the properties default and press the 'OK' button.

Starting from this moment, you can easily use HyperTerminal to test serial ports. Just type the required text in the white text area of COM3 and the written data will be transmitted via a virtual null modem cable and displayed on the screen of COM4.

As long as HyperTerminal supports data transfer via COM ports, you can use this program to perform a loopback test. If you feel the need for HyperTerminal replacement with a more advanced solution, HyperTerminal Alternative guide will help you.

Virtual Serial Port Driver

Requires: Available on Windows , 5.5MB size
Version 9.0.575 (23rd May, 2019) Release notes
Category: CommunicationApplication
Please enable JavaScript to view the comments powered by Disqus.comments powered by Disqus

I have to develop software for a USB scale that, when you press a button on it, sends serial communications over USB. I can see the values in HyperTerminal.

I am going to use the .NET classes for Serial communication to trap the data.

The problem is, I don't have the scale. The scale is connected to a remote computer I can RDP into. When I want to test, I can ask the client to press the button on the scale.

I can't ask the client to press the button 100 times a day, I need to have a way to develop with a reasonably good idea of what the scale will report, and only test when I think I have a solution.

Hyperterminal To Test Serial Port

I'm looking for something locally, that can mimic the scale and send to my .NET Serial classes, the same output as the scale. Ideally, if I could record the scale's data, and then play it back on another machine, it would be perfect.

How would I do this?

JasonJason

3 Answers

1) Abstract away your communications code. In test mode, feed your logic function from a data file stream rather than the serial stream.

or

2) If you have 2 serial ports (or two pcs), then setup a scale emulator app that talks out thru one port, and plug that into the other port where your software is running.

GeekyMonkeyGeekyMonkey

If you take the serial port emulation route, take a look at com0com. I use it all the time to fake communications with laboratory instruments and it works nicely. Very useful when you laptop lacks serial ports.

JAGJAG
Putty

Hyperterminal To Test Serial Portable

You have two problems:

  1. Test your .NET Serial classes to verify they can handle receiving data (any data) through a serial port
  2. Test your application to verify it can handle the specific type of data which you get from the scale

You can test 1. by attaching anything which can generate data (e.g. another PC with Hyperterminal) to your PC's local serial port.

You can test 2. by (for testing purposes) replacing your serial classes with software which acts as a 'mock object' for the 'serial classes + scale' combination (i.e. which feeds into your program, using the API which your serial classes would use, the data which you expect to receive from the scale).

You can also test 1 and 2, by:

Hyperterminal To Test Com Port

  • Writing a program, which pretends to be the scale by sending the type of data which the scale would send
  • Running this program to send data out of a serial port
  • Using a null modem to connct your two serial ports back-to-back (so that the data sent out of one port is received by another into your software).
ChrisWChrisW

Not the answer you're looking for? Browse other questions tagged c#.netserial-porthyperterminal or ask your own question.