IMD SolutionComputing LibraryShop main store

Troubleshooting

Legacy PLC timeout over a VMware serial port

Remote access and virtualization Published 6 min read

Short answer

The timeout is a port-number problem, not a PLC problem: the host's COM2 never crosses into the guest, which numbers the virtual serial port itself — a guest with one serial port shows COM1. Point the programming software at the COM number the guest lists, then isolate the USB adapter, the cable pinout and the serial parameters one change at a time.

On this page
  1. The host COM number never crosses into the guest
  2. Working the COM mapping: host COM2 into a Windows 95 guest
  3. Check the whole chain before buying parts
  4. Change one variable at a time
  5. Adapter, cable or VM timing — which one is left
  6. When to stop virtualizing the serial link
  7. Questions asked

The timeout is a port-number problem before it is a PLC problem. The host's COM2 never crosses into the guest: VMware hands the guest a virtual serial port, and the guest numbers it itself, so a Windows 95 guest with one serial port defined shows COM1 — and that is the port the programming software must use. The host's number matters in exactly one place, the VM setting that picks the backing device. Point the software at a COM number from the guest's own list, then work outward through the adapter, the cable and the serial parameters, changing one thing at a time. The identical timeout with the cable unplugged was to be expected: the request died at a port with no backing device, so that test told you nothing about the cable.

The host COM number never crosses into the guest #

Two operating systems, two enumerations. The Windows 10 host enumerates the USB-to-RS-232 adapter among its own devices and gives it a host COM number — COM2 here. The guest never sees that list. What the guest receives is a virtual UART, and it numbers the serial ports defined in the VM settings in its own order: the first defined serial port becomes the guest's COM1, no matter which host device backs it. VMware supports up to four serial ports per virtual machine, and each can be backed by a physical serial port on the host, by a file, or by a named pipe.

So there are two numbers with two different jobs. The host COM number is set once, in VM Settings with Add, Serial Port and the "Use physical serial port" option, to choose which host device stands behind the virtual port. The guest COM number is read out of the guest's own port list and entered in the programming software. Swap the two and you get exactly this failure: a timeout that does not change when the cable is unplugged, because no byte ever left the guest.

Hyper-V splits the same problem along a different seam, since it passes USB devices rather than host COM ports; Using a USB programming cable inside a Hyper-V VM covers that route.

Working the COM mapping: host COM2 into a Windows 95 guest #

Inputs, each from the machine in question:

  • Host: Windows 10 enumerates the USB-to-RS-232 adapter as COM2.
  • VM: one serial port defined, backed by "Use physical serial port" on host COM2.
  • Guest: Windows 95 lists COM1.
  • Documented limit: four serial ports per virtual machine, each backable by a physical port, a file or a named pipe.

Rule in words: the guest numbers the serial ports defined in the VM settings in order, with the first defined port becoming COM1. The host's number belongs to the hardware and is not inherited across the hypervisor.

The arithmetic:

  • Serial ports defined in the VM: 1.
  • First defined port enumerates in the guest as: COM1.
  • Ports the guest lists: COM1. Ports backing a guest COM2: 0.
  • Software set to COM2 addresses a port with 0 backing devices, so 0 of its requests reach the host adapter — cable attached or not.

Decision: set the software to COM1, the one port the guest lists. If the software insists on COM2, define a second serial port (2 of the 4 allowed) so the guest enumerates COM2, and back that port with the host adapter instead. The pass condition is the same either way: the software's COM setting must be a port the guest's own list shows. While it is not, every attempt times out, and no cable or adapter change can help.

Check the whole chain before buying parts #

Checkpoint Where you look What it proves
Adapter present, host COM number stable Host device and port list The host recognizes the adapter and which number the VM setting must reference
Serial port defined, backed by the right host COM, connected while the VM runs VM settings The virtual port exists and is attached to the intended device
The guest's own COM list Guest port list The number the software must use
Software port and serial parameters Programming software The software addresses the guest's port at the PLC's documented baud, parity and stop bits

The serial parameters are not the adapter's defaults to keep; they are the PLC's documented values, and one wrong parity setting produces the same silent timeout as a missing cable.

Change one variable at a time #

Do these swaps with the machine under the PLC stopped and safely isolated, or with the PLC on the bench; a serial experiment is the wrong way to learn that the machine can start.

  1. Set the software to the COM number the guest lists and retry. The port-number trap lives in this step, so run it before touching hardware.
  2. Still timing out: point the VM's serial port at a file instead of the physical port, run one connection attempt, then open the file. Characters in the file mean the software transmits and the guest side is sound; an empty file means the fault is above the adapter. Restore the physical-port backing afterwards.
  3. Swap in a second USB-to-RS-232 adapter of a different bridge type and retry with nothing else changed. Recognition by Windows proves nothing about an adapter: two bridge chips can implement different handshake lines, and legacy PLC tools are exactly the software that notices a missing one.
  4. Adapter excluded: check the cable against the vendor's programming-cable pinout with a continuity test. On a DTE-to-DTE link the transmit conductor at one end must land on receive at the other, and every handshake conductor the pinout requires must be wired through. A cable that programs an HMI is not evidence — the HMI may be the opposite device class or may not need the handshake lines at all.
  5. Last variable: the PLC end. Baud, parity, stop bits and communication mode come from the PLC's programming documentation, not from guesses.

Write down the result after each step. The step that changes the behavior names the faulty link; that is the whole method.

Adapter, cable or VM timing — which one is left #

When the port mapping is right, three candidates remain:

  • The adapter. USB bridge chips differ in which handshake lines they implement and in the latency they add. If the PLC vendor names a supported adapter, that choice ends the search; otherwise a second, different adapter is the cheapest test.
  • The cable. RS-232 — EIA/TIA-232 — fixes the signal names, the voltage levels and the pin assignment on the connector. It does not decide whether two specific devices need their transmit and receive crossed or run straight through, nor which handshake lines must be strapped: that is the vendor's cable drawing. A working HMI cable only proves the wiring for that HMI.
  • The timing. A hypervisor adds latency, and a loaded host adds jitter, to a serial exchange. If the mapping, a second adapter and a verified cable still time out, extend the tool's communication timeout where it has one; a tool with a fixed, short timeout is the one case where virtualizing the link costs more than it saves.

If every checkpoint passes and the exchange still times out in the VM, move the programming software to a physical machine with a native COM port. One move removes the USB bridge and the hypervisor, and native UART timing is what the old tool was written against. It is the same trade-off behind running legacy DOS machine software on XP or Windows 7: the older the tool, the more period hardware is part of the fix. Keep the VM for everything it does well, and record the working combination — host COM, VM backing, guest COM, serial parameters — in the machine's documentation so the next outage starts from a known state.

Questions asked

My adapter changed from COM2 to another number after I moved it to a different USB socket. What must I redo?

Windows assigns a COM number to a USB-to-serial adapter per instance, so a different socket can produce a different number. Reopen the VM's serial-port settings and repoint the physical serial port option at the new host COM number, or move the adapter back to the original socket. The guest side needs no change: it still numbers the virtual port as its own COM1.

Could VM latency alone cause the timeout?

Yes, but it is the last suspect, not the first. A pure latency fault still passes the file test — the guest transmits — and fails only against the live PLC. Correct the port mapping and rule out the adapter and cable first. If the tool exposes a communication-timeout setting, extend it. If the link works on a machine with a native COM port but not in the VM, you have proven the hypervisor was the variable.

How do I verify the cable once the vendor sends a pinout?

Unplug the cable from both ends and do a pin-to-pin continuity test between the connectors. Confirm that the transmit pin at one end reads continuous to the receive pin at the other — the crossing a DTE-to-DTE link needs — that the signal ground conductor is continuous end to end, and that every handshake conductor the pinout marks as required is wired through rather than folded back.

Where does the host COM number still matter?

Only in the VM settings. The serial port's physical-serial-port option chooses which host device backs the virtual port, and that is the single place the host number is used. If two USB-to-serial adapters are plugged into the host, this setting also decides which of them the guest can reach. Inside the guest, the host's numbering is invisible.

Keep reading

  • Troubleshooting

    Using a USB programming cable inside a Hyper-V VM

    Hyper-V gives Generation 1 guests no USB passthrough, so a Siemens USB PPI or MPI cable cannot appear inside the VM. Redirect the cable's host COM port over RDP, or move to an Ethernet-to-PPI adapter with an emulation driver on an isolated subnet; fix host-to-guest networking with an internal virtual switch and static IP addresses.

    Remote access and virtualization

  • Troubleshooting

    Fixing a VM remote PLC connection with a NAT adapter

    Set the guest's virtual adapter to NAT with DHCP, disable every other guest adapter, and keep the remote-access soft key on the host. The failure that repeats is a second bridged adapter pulling the PLC route away from the NAT path. Test the host path first, then the guest, and check that no local subnet matches the plant network.

    Remote access and virtualization

  • Troubleshooting

    Host blue screen during serial VM connection to a PLC

    A host blue screen during a VM serial session to a PLC is a Windows 10 host crash in the USB-serial and virtualization stack, not a PLC or guest fault. Capture the stop code and version stack, check whether Workstation 14 is documented for your Windows 10 build (Broadcom lists Windows 10 1903 hosts from Workstation 15.x upward), then upgrade Workstation, refresh VMware Tools, and retest before touching adapter or PLC settings.

    Remote access and virtualization