Windows Serial Port Logger

  1. Windows 7 Serial Port Sniffer
  2. Rs232 Serial Data Logger

Sep 11, 2019  A com port logger allows tracking of data being transferred using an COM (serial, RS232) port. This ability becomes crucial in many systems that still use serial ports to connect component devices. This ability becomes crucial in many systems that still use serial ports to.

-->

By Mark Russinovich

  1. Advanced Serial Data Logger - COM Port Logger. Do I need the com port logger software? Trust In Confidence! For Windows 2000 - Windows 10 (2019) (incl. Server, x86 and x64). Latest version: 4.4.3 build 911. September 11, 2019.
  2. My constraint is availability of PCs running Windows 7 64-bit only, and none of the methods I have come across work on this setup. Here are some that I've tried: How can I monitor a virtual serial port in Windows 7? I'm looking for serial port monitoring software; RS232 Packet Sniffer; Is there a free way to monitor a serial port on Windows 7 x64?
  3. Free Serial Com Port Logger Another utility that will come in handy for collecting precise data about RS232 port activity is FREE RS232 Data Logger - open source solution. This free app is written for the Windows platform and works well with Windows XP/7/8, Windows 10 (32-bit and 64-bit), Windows Server 2012, and more.

Published: January 12, 2012

Download Portmon(226 KB)
Run now from Sysinternals Live.

Introduction

Portmon is a utility that monitors and displays all serial andparallel port activity on a system. It has advanced filtering and searchcapabilities that make it a powerful tool for exploring the way Windowsworks, seeing how applications use ports, or tracking down problems insystem or application configurations.

Portmon 3.x

Version 3.x of Portmon marks the introduction of a number of powerfulfeatures.

  • Remote monitoring: Capture kernel-mode and/or Win32 debug outputfrom any computer accessible via TCP/IP - even across the Internet.You can monitor multiple remote computers simultaneously. Portmonwill even install its client software itself if you are running iton a Windows NT/2K system and are capturing from another WindowsNT/2K system in the same Network Neighborhood.
  • Most-recent-filter lists:Portmon has been extended withpowerful filtering capabilities and it remembers your most recentfilter selections, with an interface that makes it easy to reselectthem.
  • Clipboard copy: Select multiple lines in the output window andcopy their contents to the clipboard.
  • Highlighting: Highlight debug output that matches yourhighlighting filter, and even customize the highlighting colors.
  • Log-to-file: Write debug output to a file as its being captured.
  • Printing: Print all or part of captured debug output to aprinter.
  • One-file payload:Portmon is now implemented as one file.

The on-line help-file describes all these features, and more, in detail.

Installation and Use

Simply execute the Portmon program file (portmon.exe) and Portmonwill immediately start capturing debug output. To run Portmon onWindows 95 you must get the WinSock2update from Microsoft. Notethat if you run Portmon on Windows NT/2K portmon.exe must be locatedon a non-network drive and you must have administrative privilege.Menus, hot-keys, or toolbar buttons can be used to clear the window,save the monitored data to a file, search output, change the windowfont, and more. The on-line help describes all of Portmon's features.

Portmon understands all serial and parallel port I/O control (IOCTLs)commands and will display them along with interesting informationregarding their associated parameters. For read and write requestsPortmon displays the first several dozen bytes of the buffer, using'.' to represent non-printable characters. The Show Hex menu option letsyou toggle between ASCII and raw hex output of buffer data.

How it Works: WinNT

The Portmon GUI is responsible for identifying serial and parallelports. It does so by enumerating the serial ports that are configuredunder HKEY_LOCAL_MACHINEHardwareDeviceMapSerialComm and theparallel ports defined underHKEY_LOCAL_MACHINEHardwareDeviceMapParallel Ports. These keyscontain the mappings between serial and parallel port device names andthe Win32-accessible names.

When you select a port to monitor, Portmon sends a request to itsdevice driver that includes the NT name (e.g. deviceserial0) thatyou are interested in. The driver uses standard filtering APIs to attachits own filter device object to the target device object. First, it usesZwCreateFile to open the target device. Then it translates thehandle it receives back from ZwCreateFile to a device objectpointer. After creating its own filter device object that matches thecharacteristics of the target, the driver callsIoAttachDeviceByPointer to establish the filter. From that point onthe Portmon driver will see all requests aimed at the target device.

Portmon has built-in knowledge of all standard serial and parallelport IOCTLs, which are the primary way that applications and driversconfigure and read status information from ports. The IOCTLs are definedin the DDK file ddksrccommincntddser.h andddksrccommincntddpar.h, and some are documented in the DDK.

How it Works: Windows 95 and 98

On Windows 95 and 98, the Portmon GUI relies on a dynamically loadedVxD to capture serial and parallel activity. The Windows VCOMM (VirtualCommunications) device driver serves as the interface to parallel andserial devices, so applications that access ports indirectly use itsservices. The Portmon VxD uses standard VxD service hooking tointercept all accesses to VCOMM's functions. Like its NT device driver,Portmon's VxD interprets requests to display them in a friendlyformat. On Windows 95 and 98 Portmon monitors all ports so there is noport selection like on NT.

Download Portmon(226 KB)

Run now from Sysinternals Live.

Active3 years, 11 months ago

I'm working on an embedded system and it uses one serial port for all it's logging purposes.

Is there a tool out there that allows you to filter lines into different windows (or remove them altogether) so that I can separate the output of the various logging sub-systems and remove spam messages that show up multiple times a second?

I'd prefer an open-source solution, but a highly-recommend closed product might do.

Bill KBill K
55.2k13 gold badges88 silver badges140 bronze badges

closed as off-topic by Machavity, Pang, Makyen, Paul Roub, Petter FribergMar 17 '17 at 20:35

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • 'Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.' – Machavity, Pang, Makyen, Paul Roub, Petter Friberg
If this question can be reworded to fit the rules in the help center, please edit the question.

10 Answers

I've never thought of doing such a thing, but here's one product that might do the trick: Eltima Serial Port Splitter. It claims to be able to take one COM port and turn it into multiple virtual ports to connect to many applications. You might be able to take each application and just look at one kind of output.

Personally, I would just write a python script with PySerial and something like PyQT or wxPython (GUI libraries) to filter the data to different windows. It's an easy language to learn and makes a handy tool for embedded systems development for things such as this.

Jay AtkinsonJay Atkinson
2,6911 gold badge21 silver badges39 bronze badges

I would do the following:

Use Python.

  • Use Python's logging module
  • Use 3rd-party pySerial module

Write a Python program to read the serial data from the device, and translate it into log item for Python's logging module.

  • If your device's log messages have some sort of source identifier, translate that to a Python 'logger' name according to your needs, using the getLogger() function. You can define logger names any way that you need, e.g. to define log source or category.
  • If your device's log messages have a severity indication, translate it to the lvl parameter to the logger's log() method. Otherwise just use one of the logger methods such as info().

Make use of the Python logging module's config file feature to filter the data as you want in a particular situation.

  • You can filter particular log items by severity and logger name.
  • You can log to multiple destinations: You can filter and print certain log items to screen, and at the same time filter and print certain log items to one or more files. You can mix these in any combination that you want. It's very flexible.
  • You could have several logging config files, for several different logging purposes, and simply specify which one you want to use via the command line each time you run your program.

I've used Python's logging module with config files to set up my filtering, and it's really terrific.

Craig McQueenCraig McQueen
28.6k25 gold badges102 silver badges158 bronze badges

You can use the Eltima's splitter with Advanced Serial Data Logger, this software has several filter plug-ins that can filter out unnecessary messages.

Helen DownsHelen Downs

I guess it will depend on the format your logs have. If they looks like (or you can make them look like) the syslog format, you can try the following:

AlejandroAlejandro

I would personally use the Python method described above, but another (relatively easy) way to go about it would be to use sed.

Build a couple different filters to show precisely what you want from the stream, and then pipe in tail -f of your serial device file.

Paul McMillanPaul McMillan
16.8k7 gold badges48 silver badges68 bronze badges

SmarTerm allows you to connect to many different serial ports in a tabbed interface. It also has a Visual Basic like scripting language that allows you to write scripts for different needs. I wrote quite a few scripts for updating embedded software and also automating the saving of logs in multiple tabs.

As you upgrade, you still have the option to migrate to Azure by rehosting.See, for more information about your on-premises upgrade options.If you are running Windows Server 2003, you will need to. There are two modernization paths available: On-premises upgrade, or migration by rehosting in Azure. Windows server 2008 r2 ms. 2 minutes to read.In this articleExtended support for Windows Server 2008 and Windows Server 2008 R2 is ending on January 14, 2020. If you rehost in Azure, you can migrate your existing Server images free of charge.On-premises upgradeIf you need to keep your servers on-premises, and you are running Windows Server 2008 or Windows Server 2008 R2, you will need to before you can.

Mark NorgrenMark Norgren
1,1345 gold badges21 silver badges28 bronze badges

Try Powershell. You obviously need to add filtering, but this should get you started

Mathias FMathias F
9,23618 gold badges72 silver badges136 bronze badges
sanmaisanmai
11.6k8 gold badges44 silver badges68 bronze badges

My first choice is to always run PortMon (originally from SysInternals). It has a filter option where you can type in strings to include, exclude, or highlight:

I have used this for years on Windows NT/2000/XP with great success.

So, the Teenage Mutant Ninjas are Leonardo, Michelangelo, Donatello and Raphael. There are four Ninja Turtles in the team; they were named after important figures of the Renaissance. Ninja turtle games for free

Port

Hopefully, you're running a 32-bit Windows OS, because if you're running 64bit, you'll have to go with something like Eltima's product.

DaveDave
9,70212 gold badges76 silver badges137 bronze badges

There's always the venerable protocol analyzer.

You might only get one color on the screen, but it's a platform independent serial port logging solution.

Windows 7 Serial Port Sniffer

WildCrustaceanWildCrustacean
5,1811 gold badge26 silver badges40 bronze badges

Rs232 Serial Data Logger

Not the answer you're looking for? Browse other questions tagged debuggingembeddedserial-port or ask your own question.