Skip to main content

Virtual COM in a barcode scanner

Virtual COM (VCOM, USB COM, USB CDC) is a mode in which a scanner connected by USB appears to the computer as a serial port (COM) — as if it were connected with an RS-232 cable. The program then reads scanned codes directly from that port instead of receiving them as keystrokes.

By default, HDWR scanners work in USB HID mode: they type the code like a keyboard into whatever field has the cursor. Switch to Virtual COM only if your software requires it.

When do you need Virtual COM?​

  • The program reads codes from a COM port — some pharmacy, warehouse (WMS), industrial and older POS programs expect data from a serial port. The settings of such a program usually have a "scanner on COM port" option and a port-number field.
  • The computer has no RS-232 socket — Virtual COM replaces a scanner with an RS-232 cable, and the same USB scanner can still return to keyboard mode later.
  • Codes must reach the program regardless of the cursor — in COM mode the scanned code goes only to the program listening on the port, even when another window is active.

If your program accepts codes typed from the keyboard (most invoicing, sales and spreadsheet programs), stay in USB HID — it needs no configuration.

note

In Virtual COM mode, the scanner does not type into Notepad, Excel or a browser. That is expected behaviour, not a fault.

Which HDWR scanners support Virtual COM?​

The list of models that can be switched to Virtual COM is on the Which scanner model has...? page. The configuration code is on each model's page, in the interface section.

How to enable Virtual COM​

  1. Open your scanner's page in the sidebar and find the interface code — depending on the model it is called USB Virtual COM, USB COM, USB CDC virtual COM port or Virtual RS232 Port.
  2. Scan that code. The scanner beeps and reconnects as a serial device.
  3. On Windows 10 and 11 the port usually works immediately with the system driver. If the device appears with a warning icon, install the driver from your model's page.
  4. Check the port number (see below) and select it in your program's settings.

To return to the normal mode, scan the USB HID (USB keyboard) code from the same page.

How to check the COM port number​

  • Windows: open Device Manager → Ports (COM & LPT). The scanner appears as e.g. USB Serial Device (COM3) — the number in brackets is the port you select in the program.
  • macOS: the port is visible in Terminal as /dev/cu.usbmodem… (command ls /dev/cu.*).
  • Linux: the port is usually /dev/ttyACM0; the user needs permission to use serial ports (on many distributions the dialout group).

The port number can change when you plug the scanner into a different USB socket. To keep it fixed on Windows: Device Manager → the scanner's port → Properties → Port Settings → Advanced → COM Port Number.

How to test the port​

  1. Close the program that uses the scanner — only one application can open a COM port at a time.
  2. Open a serial terminal, e.g. PuTTY: connection type Serial, line COM3 (your number), speed 9600.
  3. Scan any barcode — the code should appear in the terminal window.

With a USB virtual port the speed setting usually does not matter, but if a program asks for serial parameters, start with 9600 baud, 8 data bits, no parity, 1 stop bit (8N1).

Example: a warehouse program reading from a COM port​

In programs that read the scanner from a port, the setting usually looks similar. In Weaver WMS, for example: Settings → Application settings → Barcode scanner tab → option Use a barcode scanner connected to a COM port → port number → restart the program. After the restart, scan a product code on a new document to check that it works.

Common problems​

  • No COM port in Device Manager — the scanner is still in USB HID mode (scan the Virtual COM code again), the cable only charges, or the driver is missing.
  • The program reports that the port is busy — another program (or an open terminal) is using the port. Close it and restart the program.
  • Codes stopped arriving after replugging — the port number has changed; select the new number or fix it in the port settings.
  • The code arrives, but the program does not accept it — the program expects a specific end-of-code character; add a CR (Enter) suffix with the configuration code of your model.
  • You want the scanner to type into Notepad again — scan the USB HID code.

Virtual COM FAQ

What is Virtual COM in a barcode scanner?
It is a mode in which a scanner connected by USB appears to the computer as a serial port (COM). A program that reads from a COM port receives scanned codes directly from that port, as if the scanner were connected with an RS-232 cable.
Do I need a driver for Virtual COM?
On Windows 10 and 11 the virtual port usually works with the built-in system driver. If the device appears in Device Manager with a warning icon, install the driver from your scanner model's page.
Why doesn't the scanner type into Notepad after switching to Virtual COM?
In COM mode the scanner sends data to the serial port, not as keystrokes, so only a program listening on that port receives it. To type into Notepad or Excel again, scan the USB HID code.
Why did the COM port number change?
Windows assigns the number per USB socket, so after plugging the scanner into a different socket it can get a different number. You can fix the number in Device Manager: port properties → Port Settings → Advanced → COM Port Number.
Is Virtual COM the same as RS-232?
For the program, yes — it sees a serial port. Physically the scanner is still connected by USB, so it does not need a separate power supply or a serial socket in the computer.

:::tip Did you know? The RS-232 standard that Virtual COM emulates dates back to 1960 — decades before USB. :::