Skip to content
Start free evaluation

Virtual serial manager

The virtual serial manager (pdcomm-vserial-manager) is a GUI for editing and running labs. Behind the scenes it runs pdcomm-vserial run and sends the same control commands, so a lab file you build in the GUI works unchanged from the command line and the MCP server.

The manager runs the pdcomm-vserial program in its own folder. To use a program elsewhere, set the PDCOMM_VSERIAL_BIN environment variable to its path before you start the manager.

The virtual serial manager with ports plc and hmi at 19200 bit/s, even parity, joined by a null-modem cableThe virtual serial manager with ports plc and hmi at 19200 bit/s, even parity, joined by a null-modem cable
Area Contents
Toolbar Open opens a lab file and Save saves the JSON editor’s content. Load JSON into form reads JSON you edited back into the form.
Lab Pacing, Wiring, and Trace (the trace file).
Port table For each port: Port (the node name), Endpoint type, Endpoint, Baud, Data bits, Parity, Stop bits, and Receive FIFO.
Add port, Remove port Add a port or remove the selected one.
Status and Start lab Shows the state (Stopped, Starting, Running, or Stopped with an error) and starts or stops the lab.
Running ports table Port, Endpoint type, and Open with (the path or address an application opens) of the running lab.
Faults and cables Inject faults and unplug or plug in cables while the lab runs.
JSON editor and log On the left, the lab JSON the form produces; on the right, results and errors.

The Wiring choice applies to the ports in table order:

Wiring Connects
Null-modem cable (RS-232 / RS-422) The first and second ports
Two-wire RS-485 bus All ports
Four-wire RS-422 / RS-485 bus The first port as master, the others as slaves
Loopback plug The first port

Fill in Endpoint type and Endpoint like this:

Endpoint type Endpoint
Pseudo terminal Empty, or a link path such as /tmp/pdcomm-plc
Port driver A driver port number such as 0
RFC 2217 server, Raw TCP server A listening address such as 127.0.0.1:7001; empty means 127.0.0.1:0

In Receive FIFO, 16550 (14 / 4 idle) collects characters like a 16550 UART, and Per character delivers each character on its own.

  1. Start the manager. The default form has pseudo terminal ports a and b joined by a null modem.

  2. Change the port names, speeds, and formats. The JSON editor updates with every change.

  3. To record a trace, select Write a trace and enter a file path.

  4. Click Start lab. The state changes to Running, the Open with column shows the path for each port, and the log shows Lab started with 2 ports.

    The running lab with the pseudo terminal path of each port in the running ports tableThe running lab with the pseudo terminal path of each port in the running ports table
  5. Open the path from Open with in your application.

  6. When you’re done, click Stop lab. The state changes to Stopped, and the log shows Lab stopped.

While a lab runs, the form, the JSON editor, Open, and Load JSON into form are unavailable, because the running lab keeps the settings it started with. Faults and cables is available only while a lab runs.

A parity error injected into port hmi and the cable of port plc unpluggedA parity error injected into port hmi and the cable of port plc unplugged
  • Choose a port under Port, choose a fault, and click Inject. The fault applies to the next character that port receives.

    Fault Effect
    Drop next character Drops the character.
    XOR next character Flips bits with the number to the right (0 to 255).
    Parity error, Framing error, Overrun, Break Flags that receive error.
    Noise character Immediately delivers one noise character, the number to the right, with a framing error.
  • Choose a port under Cable and click Unplug or Plug in. An unplugged port neither sends nor receives.

The log shows Done when a command succeeds and Refused: <cause> when the lab rejects it.

Add ports with Add port and set Wiring to Two-wire RS-485 bus. All ports then share one half-duplex pair. For protocols where character gaps matter, such as RTU, keep Pacing at Realistic (character time).

Three ports, master, drive1, and drive2, on a two-wire RS-485 busThree ports, master, drive1, and drive2, on a two-wire RS-485 bus

To run Modbus RTU on the bus, follow Test Modbus RTU on a virtual RS-485 bus.

The form covers the common settings. For fault probabilities, RS-485 driver control, bridges, and other settings, edit the JSON editor directly or open a lab file with Open. pdcomm-vserial commands and lab files describes every setting. If the JSON in the editor has a syntax error, the lab doesn’t start and the log shows Invalid lab JSON: <cause>.

A JSON syntax error reported in the log instead of starting the labA JSON syntax error reported in the log instead of starting the lab

If the syntax is valid but the lab file isn’t, the state changes to Stopped with an error and the log shows pdcomm-vserial: <cause>. For causes and fixes, see Lab file errors.