About this program
PortDock Serial is a test tool for exchanging data with a device over a PC COM port (including USB adapters).
It shows received data as HEX and ASCII, sends data with a checksum, shows the signal lines (DTR, RTS, CTS, DSR, RI, CD) and keeps test logs in a file.
If you unplug a USB adapter and plug it back in, it finds the same device and reconnects automatically, even if the COM number changes.
Getting started
- On first start a «What are you doing?» card appears in the log area. «Send AT commands» or «Read values from a Modbus device» sets «Use» on the left and adds example commands (names start with «e.g.») to the command list on the right. «Just watch» keeps «General» and adds no examples. «Don't show again» replaces the card with a one-line hint.
- 0. (Optional) Pick General, AT commands, Modbus RTU device or NMEA / GPS under «Use» at the top left to set the baud rate, framing and send format for that use (see «Connection settings»).
- 1. Choose a COM port under «Ports» on the left. The list refreshes every 1.5 s, so a newly plugged device appears right away.
- 2. Set «Baud rate», «Data bits», «Parity» and «Stop bits» exactly as in the device manual, then click «Connect».
- 3. Type what to send in the input at the bottom and click «Send» (or press Enter). Received data appears in the log as RX ◀, sent data as TX ▶.
- 4. To keep a test record, click «Log to file» in the toolbar and choose a file name.
Screen layout
- Left: port, baud rate, data bits, parity, stop bits, the collapsed «Advanced connection» (flow control, RS-485, DTR, RTS), «Connect»/«Disconnect», connection status, and the collapsed «Receive settings» (framing, RX checksum check). Collapsed titles summarize the current values; a group starts expanded when it differs from the defaults, and open/closed is remembered.
- Once connected, use, port, baud, advanced connection and auto-reconnect fold into one line «COM3 9600 8N1 [Change]» so the receive settings move up. [Change] expands them; baud, parity and so on still apply immediately while connected (the port only after disconnecting). They unfold again when you disconnect.
- Top toolbar (one line at 1000 px): HEX, ASCII, «Both» and «Terminal» views, «Auto-scroll», «View options ▾» (time gap column), «Log to file», «Save view», «Clear»; «☰» (commands and detail) in a narrow window.
- Below the toolbar, the find/filter row: find box, ▲/▼, «Matches only», «FAIL only», direction (All/RX/TX/EV). See «Find and filter the log».
- Status line: a summary of the current settings (e.g. «COM3 9600 8N1»), output lines DTR/RTS, input lines CTS/DSR/RI/CD, «● REC» while logging to a file (the tooltip shows the path), and on the right the total RX/TX bytes and throughput.
- Log: time, direction (RX ◀ / TX ▶ / EV) and data. With RX checksum verification on, each line ends with «OK» or «FAIL».
- Bottom: the send row (HEX/ASCII, input, «Modbus request», checksum, line ending, «Send»), the «Bytes to send» preview, «Repeat (ms)», «+ Save to list» and «⋯ More».
- Right: «Commands», «Triggers» and «Detail» (click a log line to see its HEX, ASCII and Modbus decoding).
- In a narrow window (1180 px or less) the right pane is hidden; open it with «☰ Commands · Detail» in the toolbar (just «☰» at 1100 px or less). Clicking a log line opens it at «Detail» (not when Shift/Ctrl-selecting several lines).
- 📌 in the header: always on top — keeps this window above others (same as «Always on top» in Settings).
- The window title shows the current state (e.g. «COM3 115200 8N1 · Connected ● REC — PortDock Serial»), so you can tell windows apart on the taskbar.
- At 900 px wide or less (e.g. half-screen snap) the left connection panel folds away and a summary line with «⚙ Connection» and the connect button appears. «⚙ Connection» opens the panel; ✕ or clicking outside closes it.
- The toolbar has «View options» (time gap column: none / gap from previous line / response time) and the «Terminal» view button; the right side of the status line shows throughput (RX/TX B/s), frame counts and «last RX n s ago».
- Second send row: «Repeat (ms)», «times» (only while repeating or when set), «+ Save to list» and «⋯ More» (Char delay (ms), «Break» and its ms, «Send file…», repeat count). ⚙ next to the checksum opens checksum options.
- «Triggers» sits below «Commands» in the right pane (click ▸ to expand).
Connection settings
- «Use» (above the port): sets several fields at once for what you are doing. «General» = idle gap 20 ms, no checksum check, ASCII + CR LF line ending (baud unchanged). «AT commands» = 115200 8N1, split at terminator 0D 0A, ASCII + CR LF. «Modbus RTU device» = 9600 8N1, Modbus RTU framing, RX CRC16 Modbus check, send HEX + checksum CRC16 Modbus, no line ending. «NMEA / GPS» = 9600 8N1 (change to 4800 for older receivers), split at 0A (LF), ASCII + CR LF.
- Every field can still be changed afterwards. When something differs from the preset, «(changed)» is added (e.g. «AT commands (changed)») and the differing fields are listed below. ↺ next to it resets them to the preset. The input box is cleared when the send format (HEX/ASCII) changes. The chosen use is remembered.
- «Ports»: the COM port to use. USB devices show «USB VID:PID · S/N serial number» below. Only the port is locked while connected; other settings apply immediately.
- If the saved port is not in the list, the same device is picked (by serial number, else VID:PID), otherwise the first port, with a note such as «Saved COM3 not found — switched to COM7». If replugging changed the COM number, the next connection uses the new one.
- If connecting fails, the status box turns red with «Connection failed · reason». For a busy port, check whether another program is using it.
- «Baud rate»: pick from the list (1200 to 921600) or type a number. If it does not match the device, characters look garbled.
- «Data bits»: 5, 6, 7 or 8. Usually 8.
- «Parity»: «None», «Odd», «Even», «Mark (1)» or «Space (0)». Must match the device. Mark/Space are for 9-bit addressing devices and are set directly in the Windows driver (some USB adapters refuse them — connecting tells you why).
- «Stop bits»: 1, 1.5 or 2. 1.5 usually works only with 5 data bits (otherwise a yellow note appears; if the driver refuses, connecting tells you why).
- «Advanced connection» (collapsed): flow control, RS-485 direction, DTR and RTS. The collapsed title lists what is on, e.g. «RTS/CTS · DTR», or «No flow control · DTR/RTS off» at the defaults.
- «Flow control»: «None», «Hardware (RTS/CTS)» or «Software (XON/XOFF)». Leave it at «None» unless the device uses it.
- DTR and RTS: output lines driven by the PC. Checked means on. Some boards reset when DTR changes.
- «RS-485 direction (RTS)»: switches a half-duplex RS-485 adapter's driver with RTS. «Driver toggle» lets the Windows driver raise RTS only while sending (most precise); if the driver refuses, it falls back to «Program toggle» and an event line says why. «Program toggle» raises RTS before sending and drops it once the last byte has had time to leave — USB adapter latency can drop it late and miss the start of the reply. While on, the RTS box is locked and the status line shows «RTS ⇄». Use «Off» for auto-direction adapters. Not available with hardware flow control.
- With hardware flow control the driver controls RTS, so the RTS box is locked.
- «Reconnect when plugged back in»: when on, an unplugged device shows «Waiting for device» and is reopened automatically when it comes back. When off, the port closes as soon as the device is lost.
- The same device is found by its USB serial number. Adapters without one (CH340 etc.) are reopened only when exactly one new port with the same VID:PID appears.
- While connected you can change baud rate, data bits, parity, stop bits, flow control, DTR and RTS. Changes apply without disconnecting and are logged, e.g. «SET baud 9600→115200».
Framing
Serial data arrives as a continuous byte stream, so you choose where one line (frame) ends. In every mode, whatever has arrived is released after «Idle gap (ms)» of silence.
- Framing and «Verify RX checksum» are inside the «Receive settings» group on the left; its collapsed title shows the current values, e.g. «Idle gap 20ms · No checksum check».
- «Idle gap»: split after the set time (default 20 ms) of silence. Enough in most cases.
- «Terminator»: split as soon as the bytes in «Terminator (HEX)» arrive (e.g. «0D 0A», «03»). The terminator stays in the line.
- «Terminator (HEX)» follows the same rules as HEX sending («0D 0A», «0D0A», «0x0D,0x0A») and also accepts the names CR, LF, CRLF, NUL, STX, ETX, \r and \n. The parsed bytes appear below it, e.g. «Parsed: 0D 0A (2 bytes)»; errors appear in red.
- «Fixed length»: split every «Length» bytes.
- «Modbus RTU»: replies whose length is known from the function code (05, 06, exception replies) are split at once; others by the 3.5-character time (at least 3 ms). Choosing it sets «Verify RX checksum» to CRC16 Modbus; switching to another mode restores the previous value (unless you changed it yourself meanwhile).
- An endless stream without gaps is split every 16 KB.
- Changes apply immediately while connected and add a «FRAMING …» line to the log.
USB adapter note: most USB adapters hand received data to the PC in chunks of about 16 ms. Idle gaps shorter than 16 ms, or the Modbus RTU 3.5-character time, may therefore not split reliably, and a warning appears on the left. Prefer a terminator or fixed length when possible.
Sending
Choose HEX or ASCII left of the input. While you type, «Bytes to send» shows the exact bytes and count. If the input is invalid, the reason appears there instead.
- HEX: «01 03 0A», «01030A» and «0x01,0x03,0x0A» are the same 3 bytes. Separate with spaces, commas, semicolons or hyphens.
- HEX needs two digits per byte. An odd count such as «013» gives an odd-digit error.
- ASCII: characters are sent as typed. Special characters: «\r» (CR), «\n» (LF), «\t» (tab), «\0» (0x00), «\\» (backslash), «\xNN» (one byte in two HEX digits, e.g. «\x02»).
- Examples: «AT\r\n», «\x02DATA\x03».
- «Checksum»: the checksum appended after the body (see «Checksum types»).
- «Line ending»: «None», CR, LF or CR LF appended at the very end. On first start (nothing saved yet) the send bar starts as ASCII + CR LF, so you just type «AT» and press Enter.
- If the ASCII input already ends with a line-ending escape while «Line ending» is on too, a notice says «The line ending is added twice». Click «Turn line ending off» or remove the escape from the input.
- The order is «body + checksum + line ending». The checksum covers the body only, not the line ending (⚙ options change the range and position).
- With a checksum on in ASCII mode, a yellow «+CRC16 Modbus 2 bytes» chip appears next to the input.
- You cannot send while waiting for the device to be plugged back in.
- If sending takes too long (blocked by flow control, etc.), a «Send timed out — only n/m bytes went out (check flow control / CTS)» error appears.
- Switching HEX↔ASCII converts the input to the same bytes in the new notation (e.g. «41 54 0D 0A» ↔ «AT» plus CR LF escapes). If the input cannot be read, the text is kept and a notice explains why.
- If a checksum is on when you switch, a notice (instead of a dialog) says so and offers «Turn checksum off».
Walkthrough: read values from a Modbus device
How to read registers from a Modbus RTU device (temperature controller, drive, power meter …). Example: 10 holding registers from 40001 on Slave ID 1.
- 1. From the device manual, note the line settings (baud, parity — Modbus often uses «Even»), the Slave ID and the address. Match the settings on the left and «Connect».
- 2. Set «Framing» on the left to «Modbus RTU». «Verify RX checksum» switches to CRC16 Modbus automatically. If you forget and send from the request dialog first, a one-time notice «View received data as Modbus too?» appears — [Yes, Modbus] does the same.
- 3. Click «Modbus request» in the send bar («Show walkthrough» at the bottom of the dialog opens this section). Slave ID 1, function 03 Read Holding Registers, address notation «4xxxx notation», address 40001, quantity 10.
- 4. Below the address you see the address actually sent, e.g. «40001 → 0-based 0 (0x0000)». If the manual says «address 0» or «0x0000», choose «0-based» and type that number. If values come back shifted by one, suspect this notation first. Typing 40001 or 30001 into the «0-based» box shows a yellow notice with «Switch to 4xxxx notation».
- 5. When the preview shows «01 03 00 00 00 0A», click «Send» (or press Enter in the dialog). «01 03 00 00 00 0A C5 CD» goes out with CRC16 Modbus and the dialog closes; before connecting it is blocked with «Connect first». To edit it in the send bar first, use «Put in input» (sets HEX, «CRC16 Modbus», no line ending).
- 6. The reply (RX) arrives. A request sent from the dialog is remembered, and the matching reply (same Slave ID and function, good CRC) is selected automatically. «Paired with request» under «Detail» lists values with addresses such as «40001 = 1812 (0x0714)»; the selectors switch between U16, S16, HEX, F32 ABCD, F32 CDAB and the address notation (0-based/4xxxx, starting with the one used in the dialog). An exception reply (function code + 0x80) shows its name, e.g. «Exception 02 Illegal Data Address» — check that the address and quantity are within the device's range. No reply: check Slave ID, baud, parity and wiring (A/B).
- Save frequent requests with «Save to list», and use «Repeat (ms)» to poll them.
- Address notation: 00001… coils (FC01/05/0F), 10001… discrete inputs (FC02), 30001… input registers (FC04), 40001… holding registers (FC03/06/10). Above 9999 use 6 digits such as 400001. A mismatched leading digit is explained.
- Quantity limits (protocol): read coils/inputs 2000, read registers 125, write multiple coils 1968, write multiple registers 123. Slave ID 0 is allowed only for writes (broadcast to every device) and gets no reply.
- Values are comma/space separated: decimal, 0x hex, or negative (sent as two's complement). Coils are 1 (ON) / 0 (OFF); the first value is the start address. Write Single Coil (05) sends ON = FF 00, OFF = 00 00.
Checksum types
- CRC16 Modbus: the Modbus RTU CRC, low byte first. Example: «01 03 00 00 00 0A» → «C5 CD».
- CRC16 CCITT: polynomial 0x1021, initial 0xFFFF, high byte first.
- CRC16 XMODEM: polynomial 0x1021, initial 0x0000, high byte first.
- CRC8: polynomial 0x07, initial 0x00, 1 byte.
- LRC: two's complement of the byte sum, 1 byte.
- BCC (XOR): XOR of all bytes, 1 byte.
- SUM8: low 8 bits of the byte sum, 1 byte.
- SUM16: 16-bit byte sum, high byte first, 2 bytes.
- CRC-32: ISO-HDLC (as in zip/Ethernet), 4 bytes, low byte first.
- CRC (custom): a generic CRC with your own width, poly, init, refin, refout and xorout, high byte first.
By default the checksum covers the whole body from the first byte and is appended at the end. For devices that leave out a header such as STX or put the checksum before ETX, use the ⚙ options next to the checksum (see «Checksum options, CRC-32 and custom CRC»).
Repeat and commands
- «Repeat (ms)»: the input as it was when you checked the box is sent at the set interval, shown next to it as «Repeating: 01 03 …». Editing the input does not change what repeats; uncheck and check again to update it.
- Repeat turns off if the connection drops and the log shows «REPEAT stopped (disconnected)». It does not restart by itself after reconnecting.
- If the interval is shorter than the real transmit time, sends would pile up, so the program raises it to the shortest usable interval (a warning appears).
- «+ Save to list»: adds the current input (with mode, checksum and line ending) to «Commands» on the right. The name comes from the start of the input and can be edited.
- Commands are kept when you restart the program.
- In the list, ▶ sends (Enter or double-click in the name too), ✎ is «Load into the input», ⧉ duplicates and ✕ deletes. A deleted command can be restored with «Undo» in the notice for 5 seconds (no confirmation dialog).
- Reorder with ↑/↓ left of the name, or Alt+↑/↓ in the name box.
- When the list is empty, «Add examples» puts in a few common example commands (names start with «e.g.»). Serial follows «Use»: AT, ATI, AT+GMR or Modbus FC03/FC04 reads; TCP adds *IDN? (SCPI), an HTTP request and a Modbus TCP read (two Modbus TCP reads when framing is Modbus TCP); UDP adds a text, *IDN? and a HEX example. No write commands are added.
- After «+ Add to list» the new command's name box is focused so you can rename it right away. «Add to commands» in a log line's right-click menu adds those exact bytes (HEX, no checksum or line ending).
- «Export list» / «Import list» move only the command list as a JSON file (to another PC or another PortDock program). When importing into a non-empty list, choose «Append» or «Replace list» in place; «Undo» works afterwards too.
RX checksum verification
Choose a type in «Verify RX checksum» and each received line is checked for a correct checksum at its end, marked «OK» (green) or «FAIL» (red).
- If framing is «Terminator» and the line ends with that terminator, the terminator is removed and the checksum before it is checked. This matches sending «body + checksum + suffix».
- Lines shorter than the checksum are not marked.
- In the file log a correct line gets «[OK]» and a wrong one «[CHECK FAIL]».
- If frames are split wrongly (two replies merged into one line, etc.), the checksum shows «FAIL» too. Check framing first.
Log and event lines (EV)
EV lines appear between RX and TX lines. They record events such as connecting, setting changes and signal changes, and are written to the file log as well.
- OPEN: the port was opened. Example: «OPEN COM3 9600 8N1 flow=none DTR=0 RTS=0».
- FRAMING: the framing mode. Examples: «FRAMING gap 20ms», «FRAMING terminator [0D 0A] gap 100ms», «FRAMING modbus-rtu @9600».
- RXCHECK: the RX checksum type changed («none» when turned off).
- SET: a setting changed while connected, e.g. «SET baud 9600→115200, DTR 0→1». While waiting for the device, «(applies on reconnect)» is added.
- LOST: the connection was lost because the device was removed or a read failed. The reason follows.
- RECONNECT: the same device was reopened. If the COM number changed it reads «RECONNECT COM3 → COM5». Turning off auto reconnect while waiting gives «RECONNECT cancelled».
- CLOSE: the port was closed.
- CTS ON/OFF, DSR ON/OFF, RI ON/OFF, CD ON/OFF: an input line from the device changed (checked every 0.1 s).
- LOG START: file logging started. The port settings at that moment are written too, so the log alone shows the test conditions.
- REPEAT stopped (disconnected / send error): why repeat sending turned off. This line is shown on screen only, not written to the file log.
- TRIGGER «name»: a trigger matched (may end with «— repeat stopped» / «— file log stopped»). Screen only.
- REPEAT done (n sent): the repeat count was reached. Screen only.
- LOG NEXT new name / LOG PART 2 (prev old name): the file log was split by size or time and continues in the next file (written to both files).
- SEND CANCELLED sent/total: a file send (or a character-delayed send) was cancelled.
- BREAK 100ms: a Break signal was sent.
- RS485 driver toggle (RTS_CONTROL_TOGGLE) refused …: the driver refused toggling, so the program toggles RTS instead.
- Follow: new lines are followed only while you are at the bottom. Scroll up to pause (the view stays put) — «↓ Jump to latest (n new)» appears at the bottom right. Click it, press End or scroll to the bottom to follow again. The «Auto-scroll» checkbox shows whether it is following.
- Selecting: click a line, Shift+click for a range, Ctrl+click to add or remove one. Clicking does not stop following.
- Right-click menu: Copy lines · Copy HEX · Copy ASCII · Copy HEX + ASCII · Copy as C array ({0x01, 0x03}) · Send again (TX lines — exactly those bytes) · Add to commands · Find this. Data copies (HEX, ASCII, C array) skip event lines (EV), one frame per line.
Find and filter the log
The row just below the toolbar finds and filters log lines. Filtering only changes the view — nothing is deleted, and the file log is not affected.
- Find box: 2-digit HEX groups such as «01 03» search bytes; anything else searches text (case-insensitive). Pick «Auto», «HEX» or «Text» next to it when ambiguous (e.g. «0A»). Event lines (EV) are searched by their description in text mode.
- Matches are highlighted; ▲/▼ (or Enter/Shift+Enter) select the previous/next match. «3/17» means the third of 17 matches («–/17» when the selected line is not a match).
- «Matches only» shows only matching lines. «FAIL only» shows only lines whose RX checksum failed. The direction box: «All», RX, TX, EV.
- While filtering, «120 of 5,000 lines» appears on the right; ✕ turns everything off. New lines keep arriving and appear when they match.
- «CHECK FAIL n» in the toolbar counts lines with a failed checksum since the last «Clear» (shown only when there are any). Click it to toggle «FAIL only».
- Keys: Ctrl+F focuses the find box, Enter next, Shift+Enter previous, Esc clears the text (press again to clear all filters).
Saving and detail
- «Log to file»: appends RX, TX and EV to the chosen file continuously (an existing file is appended to, not overwritten), regardless of the screen line limit. Click again («Stop logging») to stop.
- A file line (HEX format) looks like «2026-10-17 21:05:03.123 RX 01 03 00 00 [OK]». Event lines look like «… EV OPEN …». For the ASCII, HEX + ASCII and CSV formats see «Text encoding and file log format».
- «Save view»: saves the lines on screen to a text file in the current «View» (HEX, ASCII, or «Both» as «HEX | ASCII»). With a filter on, only the visible lines are saved. The first line (starting with #) records the view, filter and line count. Times follow «Log timestamp» in Settings; lines with a failed checksum end with «[CHECK FAIL]». (The line format of «Log to file» follows «File log format» in Settings regardless of the view — HEX by default.)
- «Clear»: empties the screen log and the RX/TX byte counts. The file log is not affected.
- Clicking a log line shows its byte count, HEX and ASCII in «Detail» on the right (following continues).
- If framing is «Modbus RTU» or the line ends with a valid CRC16 Modbus, «Detail» also shows the Modbus decoding (Slave ID, function code, fields such as start address and count, «Values», CRC «OK»/«FAIL»). Other lines show just «Not a Modbus frame (CRC mismatch)».
- In ASCII view, control characters appear as «<CR>», «<LF>», «<TAB>», «<STX>», «<ETX>», «<ACK>», «<NAK>», others as «<1B>» and so on. Bytes 0x80 and up are read with «Text encoding» in Settings (UTF-8, CP949, Latin-1, ASCII); unreadable ones show as «<C7>».
Warning messages
- «Waiting for the device to be plugged back in — cannot send.»: the device was removed and the program is waiting. Plug the cable back in and it reconnects by itself.
- «Repeat interval a ms is shorter than the transmit time; sending every b ms.»: at this baud rate the data cannot go out within the interval. Lengthen the interval or raise the baud rate.
- «With software flow control, bytes 0x11 (XON) and 0x13 (XOFF) …»: the data contains 0x11 or 0x13, which may be eaten as flow signals. For binary data use «None» or hardware flow control.
- «With hardware flow control (RTS/CTS) the driver controls RTS.»: information only. Turn flow control off to set RTS yourself.
- «The terminator is empty, so frames split by idle gap only.»: the «Terminator (HEX)» box is empty. Enter something like «0D 0A». If the box is invalid (odd digits, non-HEX), a red reason appears and frames also split by idle gap only.
- «USB adapters usually deliver data in ~16 ms chunks …»: shown for a USB port with a short idle gap or Modbus RTU. See «Framing».
- Settings: «Automatic logging will not start until a folder is chosen.»: you turned on «Start file logging on connect»; pick a folder with «Choose».
- Settings: «Stop the connection and logging before importing.»: importing reloads the screen, so «Disconnect» and «Stop logging» first.
Settings (⚙)
- «Language»: 한국어 or English.
- «Theme»: «Follow Windows», «Light» or «Dark».
- «Font size (px)»: 11 to 18.
- «Log timestamp»: «hh:mm:ss.ms», «Date + time», «UTC» or «Elapsed since start (Clear resets)» (counted from the connect time, or from the last «Clear»). Applies to the screen and «Save view» (the file log always uses date + time).
- «Lines kept on screen»: 1,000 to 1,000,000 (default 100,000). Older lines are dropped from the screen only.
- «Auto-scroll on new lines»: the initial state of «Auto-scroll» (follow) when the program starts. Scrolling up still pauses it.
- «Start file logging on connect»: with an «Auto-log folder» chosen, every connection starts logging to «portdock-serial-date-time.log».
- «Ask before closing while connected or logging»: protects a running test from an accidental close.
- «Export settings» and «Import settings»: move display settings and commands as a JSON file. Files from other PortDock programs are refused.
- «Reset to defaults»: resets display settings only (commands are kept).
- «Always on top»: keeps this window above other windows (same as 📌 in the header).
- «Expand all (expert view)»: shows the groups that are normally collapsed (advanced connection, receive settings, fault injection, statistics, scan options, triggers, auto-reply …) open. Folding one while it is on lasts only for this run. Turning it off returns each group to its remembered state.
Shortcuts and tips
- F4: connect / disconnect (same as the button on the left).
- Ctrl+L: clear the on-screen log (file logs are kept).
- Ctrl+S: save view.
- Ctrl+Shift+L: start / stop logging to file.
- Esc: stop repeat sending (outside text boxes — inside a box Esc keeps its own meaning).
- End: jump to the latest log line and follow again.
- Ctrl+C: copy the selected log lines as «time direction data» (in the current view). Inside a text box it copies normally.
- Ctrl+F: focus the log find box. In it, Enter next, Shift+Enter previous, Esc clear.
- F1 or the ? button: this help. Close it with Esc.
- Number boxes: ↑/↓ by 1, Shift+↑/↓ by 10, PageUp/PageDown by 100, or the mouse wheel once the box is focused. The baud box steps through the listed rates.
- Shortcuts are ignored while a dialog or the right-click menu is open, or while composing Korean text.
- ↑/↓ in the send box: recall earlier sends (history).
- F2, F3, F5–F12: send the command with that key (the «Key» box in the command list).
- Enter in the input: send (when connected and there are bytes to send).
- In a narrow window, open the right pane with «☰ Commands · Detail» (clicking a log line opens it too) and close it with ✕ or by clicking outside.
- Connection settings, framing, the input and commands are kept for next time.
Input history and command hotkeys
- ↑/↓ in the send box recall earlier sends (last 50, with their HEX/ASCII mode). Sending the same thing again just moves it to the end. History is kept across restarts.
- Your unsent edit is never lost — it is set aside on the first ↑ and comes back with ↓ at the bottom. ↑/↓ do nothing while composing Korean text.
- Only sends from the «Send» button and Enter in the box are remembered (not repeat, commands or Send again).
- Command hotkeys: pick F2, F3 or F5–F12 in a command's «Key» box to send it with that key (works even while typing in the send box). F1 (help) and F4 (connect) are reserved; keys used by another command show greyed out as «F7 — «name»».
- Hotkeys are saved in exported command lists. Duplicated commands get no key, and keys already in use are dropped on import. Hotkeys are ignored while a dialog or the right-click menu is open.
Time gap column, throughput and repeat count
- «Time gap column» in the toolbar's «View options»: «Gap from previous line» shows the time since the previous RX/TX line (+12 ms); «Response time (TX→RX)» the time from the last TX to this RX. It appears next to the time and is included in line copies (Ctrl+C) and «Save view». Event lines (EV) stay empty.
- Times have 1 ms resolution and include USB adapter / OS delivery delays (a few ms); use an oscilloscope for exact device timing.
- Right side of the status line: «RX 1.2 KB/s · TX 0 B/s» is the throughput over the last second, «frames 120/30» the lines received/sent since «Clear», and «last RX 3 s ago» the time of the last reception. It turns red after 10 s of silence while running.
- The «times» box next to «Repeat (ms)» (shown only while repeating or when a count is set — set it beforehand under «⋯ More»): repeat stops by itself after that many sends (0 = until turned off). «sent 3/10» shows progress, and «REPEAT done (10 sent)» is added as an event line (screen only).
Triggers
Open «Triggers» in the right pane and click «+ Trigger». When a received line (RX) contains the pattern, the chosen actions run.
- Pattern — HEX: «01 03 ?? **» (?? = any byte, ** = zero or more bytes). ASCII: e.g. «ALARM*» (? = any byte, * = zero or more, \r \n \xNN escapes, a literal ? is \x3F). Matches anywhere in the line, case-sensitive — the same rules as an auto-reply rule with «Wildcards» on.
- Actions: «Color» (pick a color) · «Beep» · «Stop repeat» · «Stop log» (turns off Log to file) · «Event line» (an EV line «TRIGGER «name»») · «Flash» (flashes the taskbar when the window is in the background). Stopping repeat or logging is noted in the event line too.
- Each trigger shows its hit count (e.g. «3×»), the header the total. «Reset counts» starts again from 0. Unchecking pauses one trigger; deleting can be undone for 5 seconds.
- Triggers run on screen only (colors and event lines are not written to the file log). The list is kept across restarts.
Checksum options, CRC-32 and custom CRC
Click ⚙ next to the checksum in the send bar or in «Verify RX checksum» to open the options. ⚙• means options are on.
- «Leading bytes left out of the calculation»: leaves a header such as STX or an address out.
- «Insert this many bytes before the end»: puts the checksum m bytes before the end (before ETX etc.); those m bytes are left out of the calculation too. Example: «\x02AB\x03» + BCC, skip 1, before end 1 → 02 41 42 [03] 03. The line ending (CR LF) is still appended at the very end.
- «Reverse byte order»: swaps 2- and 4-byte checksums. By default CRC16 Modbus and CRC-32 are low byte first; CCITT, XMODEM, SUM16 and custom CRC high byte first.
- RX verification uses the same options — it skips the first n bytes and compares the checksum m bytes before the end (the terminator is removed first in terminator mode).
- «CRC-32»: ISO-HDLC (as in zip/Ethernet), 4 bytes. «CRC (custom)»: width 8/16/32, poly, init, xorout (HEX), refin and refout exactly as in the reveng catalogue. «Preset» offers CRC-16/ARC, KERMIT, X.25, DNP, CRC-32/MPEG-2, CRC-32C and more. Values that do not fit the width are flagged in red and nothing is sent.
- Checksum options are saved and exported with commands.
Text encoding and file log format
The «Text and file log» part of Settings (⚙).
- «Text encoding»: UTF-8 (default), CP949 (EUC-KR), Latin-1, ASCII. Used for the ASCII view, copies and saves, and for characters sent in ASCII mode. Bytes the encoding cannot read appear as «<C7>», control characters as «<CR>». If a character to send is not in the encoding, «Bytes to send» explains why and nothing is sent (\xNN escapes always give that byte). Korean text in the log search is matched as UTF-8 bytes — search CP949 lines in HEX.
- «File log format»: HEX (as before), ASCII (text), HEX + ASCII, or CSV (for Excel: «ts,dir,len,hex,ascii,check,note,peer», UTF-8 BOM). CSV cells starting with = + - @ get a leading ' so Excel does not treat them as formulas. With CSV the save dialog suggests a .csv name.
- «Split by size (MB)» / «Split by time (hours)»: logging continues in «name-002.log», «name-003.log» … The old file ends with «LOG NEXT new name» and the new one starts with «LOG PART 2 (prev old name)». 0 means never split.
- Format and splitting apply from the next file log you start (the current file is unchanged).
Send file and character delay
- «Char delay (ms)» in the send bar's «⋯ More»: pauses this long between bytes for every send (Send, repeat, commands, Send again) — for slow devices with small buffers. 0 sends everything at once. When it is not 0, the «⋯ More» button shows «char delay n ms».
- «Send file…» (in «⋯ More»): choose a file (open dialog) and send it byte for byte — no checksum or line ending is added. Up to 32 MB.
- «Split»: «Chunks» sends a fixed size (256 bytes by default) at a time; «Lines» splits after LF, CR LF or a lone CR and sends line by line. «Delay between characters» pauses between bytes, «Delay between lines/chunks» between lines (chunks).
- While sending, a progress bar and «Sending 45% (1,843/4,096 bytes)» appear in the dialog and under the send bar, and the log shows a TX line per line/chunk. «Cancel sending» stops right there and logs «SEND CANCELLED 1843/4096». A disconnect stops it too.
- Closing the dialog does not stop sending. After choosing a file, its size and an estimated time (from speed and delays) are shown.
Break and terminal view
- «Break» (in «⋯ More» on the send bar): holds the TX line at 0 (space) for the time in the box next to it (ms, default 100). Used for LIN/DMX, some devices' attention signal and bootloader entry. It goes out after earlier sends and is logged as «BREAK 100ms».
- «Terminal» in the toolbar: joins received text regardless of framing, starts new lines at CR/LF (CR LF counts once) and applies ANSI colors (ESC [ … m) — handy for Linux consoles, boot logs and AT replies. Long lines wrap.
- Turn off «ANSI colors» in the terminal view to see plain text. Other ESC sequences (cursor moves, screen clears) are dropped, tabs become 4 spaces and backspace removes the previous character.
- The terminal view shows received data (RX) only; switch back to «HEX»/«ASCII» to see sent data and event lines. Text is read with «Text encoding» in Settings, and the last 5,000 lines are kept («Clear» empties it).
Auto reply
«▸ Auto reply» in the right pane answers received lines with the same rules as Simulator — no separate device simulator needed.
- «On» in its header turns it on or off (green when on). Rules are kept while off and reply as soon as it is on. Rules, the switch and match options survive restarts.
- A rule: «When» pattern (HEX/ASCII, «exact»/«contains», HEX wildcards ??/**) → «Reply» (checksum, line ending, delay). The first matching rule replies, and every reply is logged as «AUTO name».
- ASCII patterns compare literally (the default for new rules — SCPI «*IDN?» as is). Turn on a rule's «Wildcards» to make ? any one character and * zero or more. Rules saved before 10/18 load with it on, so they behave as before.
- With no rules, the [Modbus RTU 03 reply] [SCPI *IDN? reply] [Echo] example buttons give you a start. A new rule takes the format of the rule above it (HEX/ASCII, exact/contains, reply format, line ending).
- «Ignore line ending when matching» strips the framing terminator and CR/LF before comparing. «Log unmatched requests (NO MATCH)» logs «NO MATCH — closest: name» when no rule matches.
- Replies go back to the sender (TCP server: that connection; UDP: the sender's address). If our own reply comes straight back, it is not answered again, so endless ping-pong cannot start.
- The number on each card is its reply count; «Reset counts» sets it to 0. An invalid rule turns red and only that rule is skipped.
- This is a simple auto reply riding on the connection. For many rules or device emulation (unsolicited sends and fault emulation included) use PortDock Simulator — a note under the panel says so too.
Reply templates ({…} fields)
A reply may contain {…} fields that are filled for every request. They work in HEX and ASCII, and «Insert field» next to the reply puts one at the cursor.
- {req} whole request · {req 0..1} request bytes 0–1 (inclusive) · {req 6} one byte · {req 2..} byte 2 to the end · {req -2..-1} the last 2 bytes (negative counts from the end, -1 = last).
- {counter} how many times this rule has replied (from 0), 1 byte · {counter 2} / {counter 4} size in bytes · add le for little-endian (default big-endian) · {counter dec} decimal text. «Reset counts» starts over at 0.
- {rand 0..100} random value in the range (inclusive; size 1/2/4 bytes to fit the max) · {rand 0..1000 2 le} explicit size and order · {rand 10..99 dec} decimal text.
- {time} current time «HH:MM:SS» as text · {time %Y-%m-%d %H:%M:%S} custom format · {unix} Unix seconds · {unix ms} milliseconds.
- {crc kind} checksum of all bytes before this field, placed here · {crc bcc 1..-1} explicit range (counted over the reply without checksum fields) · add swap to reverse the byte order. Kinds: crc16-modbus, crc16-ccitt, crc16-xmodem, crc8, lrc, bcc, sum8, sum16, crc32.
- Order: fill fields → {crc} fields → the rule's «Checksum» (over everything) → «Line ending». So «01 03 02 {req 4..5}» with checksum CRC16 Modbus equals «01 03 02 {req 4..5} {crc crc16-modbus}».
- Example — Modbus TCP read of 2 holding registers: when «?? ?? 00 00 00 06 ?? 03 **», reply «{req 0..1} 00 00 00 07 {req 6} 03 04 00 64 00 C8». The transaction ID (bytes 0–1) and MBAP Unit ID (byte 6, the Slave ID) are echoed so the master can pair them. MBAP has no CRC, so set checksum to «None».
- Example — a device with sequence numbers: «ACK {counter dec}\r\n» (ASCII). Example — BCC after STX…ETX: «02 {req 1..-2} 03 {crc bcc 1..-1}».
- If a request is too short for a field such as {req 9}, nothing is sent and the log shows «AUTO name — request range …». A { that does not start a known name (req, counter, rand, time, unix, crc) is sent as is (e.g. {"ok":1}). To send text like «{req» literally, write \x7B in ASCII.
- Type a request into «Sample request» under «More» (same HEX/ASCII as the pattern) to see whether it matches and the exact reply bytes. It is filled with count 0 and sample random values, so real values differ.
Fault injection and rotating replies
Expand «▸ More» on a rule card to test the host's timeout, retry and state handling. Active options are always shown as small tags under the card («delay 10–50 ms», «drop 1 in 3», …).
- «Delay range»: replies after a random delay between the start and end (ms) every time (jitter). If the end is not above the start, the start is a fixed delay. The log shows the real delay, e.g. «AUTO name +37ms».
- «drop every Nth request»: the Nth, 2Nth … requests matching this rule get no answer (0 = off). «% = drop by chance» drops with that probability. Dropped requests are logged as «DROP name — …» and do not count as replies.
- «Rotate replies»: with several replies («+ Add reply»), each match sends the next one «in sequence» (1 → 2 → … → 1) or a «random» one — to mimic a device whose state changes (idle → running → done). The log shows which, e.g. «AUTO name [2/3]».
- «In sequence» and {counter} use the rule's reply count — «Reset counts» starts over. Editing a rule (same name) keeps counting.
Troubleshooting
- No port listed: check that the COM port appears in Device Manager and that the adapter driver (CH340, FTDI, CP210x, etc.) is installed. The list refreshes every 1.5 s.
- «… is already open»: this program has already opened, or is opening, that port.
- «Access is denied»: another program (a terminal, another PortDock window, etc.) is using the port. Close it and connect again.
- Garbled characters: baud rate, data bits, parity or stop bits differ from the device.
- Data merged or split: this can come from the 16 ms delivery of USB adapters. Lengthen the idle gap or use «Terminator» or «Fixed length».
- Checksum «FAIL»: check the checksum type, whether frames are split correctly, and whether the device leaves a header byte (STX etc.) out of the calculation. The terminator is removed before checking only in «Terminator» mode.
- Send timed out: flow control is holding the data back. Set flow control to «None» or check the CTS lamp.
- No reconnect after replugging: with several adapters that have no serial number, the program cannot tell which is which and keeps waiting. «Disconnect», pick the port and connect again.
- «This port (driver) does not accept parity mark …»: the adapter does not support Mark/Space parity or 1.5 stop bits. Use another adapter (FTDI etc.) or change the device setting.
- RS-485: the start of the reply is garbled: «Program toggle» is dropping RTS late. Use «Driver toggle» or an auto-direction adapter. No reply at all: check A/B wiring and termination.
- Windows 7 is not supported. Use Windows 10 or 11.
- The program does not open: the screen needs Microsoft Edge WebView2. Windows 11 includes it; otherwise the installer downloads it (internet required). On an offline PC, download and install the WebView2 Runtime installer separately.