PortDock

PortDock SCPI Guide

SCPI instrument terminal — LAN socket and RS-232, no VISA

About

PortDock SCPI is an «instrument terminal» for SCPI test equipment (power supplies, multimeters, oscilloscopes, signal generators, loads …): send commands and read the answers. No VISA (NI-VISA, Keysight IO Libraries) needed.

  • Connections: LAN «socket» (raw SCPI socket, usually TCP 5025) and serial (RS-232).
  • Query, write and read with response times, *IDN? identification, *RST and *CLS, error queue draining (SYST:ERR? until 0), *OPC? waits.
  • Command history (↑↓) and command list, completion for common SCPI commands, repeated numeric measurements (table, trend, statistics, CSV), and IEEE 488.2 block data (#…) with HEX preview and file save.
  • Free (GPL-3.0); the interface is in Korean and English.

Getting started

  • 1. Look up the IP in the instrument's front-panel LAN settings and check that the «socket» service (Sockets, raw SCPI, port 5025) is on. PortDock Net Scan can find the IP.
  • 2. On the left, «Connection» LAN → IP in «Instrument address», «Port» 5025 (usually leave it) → «Connect» (F4).
  • 3. On connect, *IDN? fills «Instrument» on the left with maker, model, serial number and firmware (turn off «Ask *IDN? on connect» to skip).
  • 4. Type a command in the box at the top and press Enter — ending in ? it «queries» (sends and waits), otherwise it «writes» (sends only). The answer and response time appear in «Last reply», the exchanged lines in «Traffic».
  • 5. Wrong commands go to the instrument's error queue. Check it now and then with «Drain error queue».
  • RS-232 instruments: «Connection» Serial → port, baud, parity, stop bits and flow control as set on the instrument. Match the line ending too (usually LF, sometimes CR LF).

Layout

  • Left: connection and address (or port and baud), «Line ending», «Timing» (response timeout, *OPC? timeout, ask *IDN? on connect), the connect button and status, «Instrument» (*IDN? decoded), «Common actions» (*IDN?, *RST, *CLS, drain error queue, wait *OPC?) with the error queue result.
  • Top centre: the command box with [Query] [Write] [Read] [+ To list]. While waiting, [Stop] (Esc). Under the box: what the command means (for common commands) and what Enter will do.
  • Centre: «Last reply» — the text (or block info, HEX preview and [Save to file]), response time and failure reasons.
  • Bottom: tabs «Traffic» / «Repeat measurement».
  • Right: the command list (in a narrow window, open it with the «Commands» button).
  • 📌 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.

Query, write and read

  • «Query»: sends and waits for one reply. The response time runs from the end of sending to the end of the reply (line ending or block end). Late bytes left over from an earlier query are discarded first, with an event line «Discarded n late bytes».
  • «Write»: sends only — for setting commands (CONF:VOLT:DC 10, OUTP ON …).
  • «Read»: reads one reply without sending — after sending a query with «Write», or for data the instrument sends by itself.
  • Enter queries when the command ends in ?, otherwise it writes. Chained commands (*CLS;*OPC?) query if any part ends in ?.
  • «Line ending» is appended when sending and marks the end of replies. LF and CR LF split at LF and drop a preceding CR; CR splits at CR. It can change while connected.
  • If the timeout passes with something received, it is shown as «Received: …» — usually the line ending does not match the instrument.

Identification, error queue and *OPC?

  • *IDN?: an IEEE 488.2 common command. The answer «maker,model,serial,firmware» is split into «Instrument». Anything else is shown as received.
  • *RST resets the instrument to its default setup (ranges and outputs change — mind a supply with its output on). *CLS clears the status registers and error queue.
  • «Drain error queue» asks SYST:ERR? until «0,"No error"» (or +0), at most 50 times, and lists the errors like «-113 Undefined header». It says so if 50 reads did not finish or the answer does not start with a number.
  • Common errors: -113 Undefined header (unknown command, typo), -222 Data out of range, -410 Query INTERRUPTED (a new command before the answer was read), -420 Query UNTERMINATED (read without a pending answer).
  • «Wait *OPC?»: the instrument answers 1 when pending operations finish — use it after long operations such as sweeps or initialisation. The wait is «*OPC? timeout (ms)» under «Timing» (30 s by default).

Block data (#…)

  • Large answers such as screenshots and waveforms come as IEEE 488.2 «definite length blocks»: «#», digit count N, length (N digits), data. E.g. «#41000» followed by 1000 bytes.
  • The length header tells where the data ends, so LF bytes (0x0A) inside binary data do not cut it. A line ending after the block is read with it.
  • «#0…» (unknown length) is read up to the line ending — binary data containing that byte can be cut, so pick a definite-length format on the instrument.
  • «Last reply» shows the header, length, text or binary and the first 1024 bytes in HEX. [Save to file] writes the data without the header (PNG, BMP, JPG and GIF get that extension suggested).
  • One reply can be up to 64 MB. Traffic lines keep only the beginning.

Repeat measurement

  • «Repeat measurement» tab: «Command» (a query answering with a number — MEAS:VOLT:DC?, READ?, FETC?), «Interval (ms)», «Count» (0 = until stopped) → «Start». Stop with Esc or «Stop».
  • The interval is between measurement starts. If a reply takes longer, the next query follows right after it.
  • The first value (before a comma) is read as a number; trailing unit letters as in «1.5 V» are ignored. SCPI 9.9E37 shows as overload (+OVLD) and 9.91E37 as NaN; both leave a gap in the trend.
  • Timeouts are recorded as failed rows and it continues; it stops if the connection drops.
  • Value table (last 500 rows), trend (last 1000), statistics (count, min, max, mean, standard deviation) and [Save CSV] (index, time, response time, value, reply text — opens in Excel).

Common SCPI commands

  • The completion list holds only IEEE 488.2 common commands (*IDN?, *RST, *CLS, *OPC?, *WAI, *ESR?, *STB?, *SRE, *ESE, *TST?, *OPT?, *TRG, *SAV, *RCL) and SCPI basics (SYST:ERR?, SYST:VERS?, SYST:PRES, STAT:PRES, STAT:OPER:COND?, STAT:QUES:COND?, MEAS:VOLT:DC?, MEAS:CURR:DC?, MEAS:RES?, MEAS:FREQ?, CONF?, READ?, INIT, FETC?, ABOR). See the instrument's programming guide for its own commands.
  • The short form (MEAS:VOLT:DC?) and long form (MEASURE:VOLTAGE:DC?) are the same command, in any letter case. For listed commands the meaning appears under the box.
  • Keep frequent commands in the command list (right) and send them with ▶ or F2, F3, F5–F12. «Add examples» in an empty list adds *IDN?, MEAS:VOLT:DC? and SYST:ERR?. Commands ending in ? are queried, others written.

Try it with Simulator (no instrument)

Without a real instrument, PortDock Simulator can play one on the same PC.

  • 1. Open PortDock Simulator: mode «TCP server (peer connects)», port 5025, framing «Terminator» 0A (LF).
  • 2. With no rules yet, click the [SCPI *IDN? reply] example. The rule is ASCII «*IDN?» → «PORTDOCK,SIM,1» with CR LF, «Wildcards» off — keep it off so ? and * compare literally.
  • 3. With «+ Add rule» add «MEAS:VOLT:DC?» → «+1.2{rand 0..9}E+00» (the last digit changes on each request) and «SYST:ERR?» → «+0,"No error"» (new rules inherit the format and line ending of the rule above and start with wildcards off).
  • 4. «Start» Simulator. In PortDock SCPI: LAN, address 127.0.0.1, port 5025, line ending LF → «Connect». «Instrument» shows PORTDOCK · SIM · 1 (Simulator answers with CR LF; replies split at LF with the CR dropped).
  • 5. «Drain error queue» → «No errors ✓». In «Repeat measurement»: MEAS:VOLT:DC?, interval 500, count 20 → «Start» → table, trend and statistics → [Save CSV].
  • 6. Querying a command without a rule (e.g. VOLT?) times out with «No reply» — a real instrument would also queue -113.
  • With wildcards on, ? and * in «*IDN?» match any character, so odd requests like «XIDN!» get answered too. Keep them off for SCPI rules.

Out of scope (not yet)

  • VXI-11 (LAN, RPC — port 111 plus dynamic ports): planned for a later version. Use the instrument's «socket (5025)» for now; most LAN instruments offer both.
  • HiSLIP (4880), USBTMC (USB) and GPIB need VISA or drivers and are not supported. A USB-only instrument with a «USB virtual COM» option can be used as serial.
  • VISA features such as service requests (SRQ), device clear and remote/local switching do not exist on a socket. Use *OPC? to wait while the instrument is busy.

Traffic

  • TX ▶ sent commands, RX ◀ replies, EV events (connect, disconnect, timeouts, discarded late bytes). Control characters such as line endings show as <CR>, <LF>. Timeouts and disconnects are red event lines.
  • With «Response time» on, RX lines carry «12.3 ms» (for blocks «#41000 · 1000 B · 12.3 ms»).
  • Find/filter, follow, line selection and copying work as in the other PortDock programs. «Save view» (Ctrl+S) writes the visible lines to a text file; «Log to file» (Ctrl+Shift+L) keeps appending new lines to a file.
  • 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}) · Find this. Data copies (HEX, ASCII, C array) skip event lines (EV), one frame per line.

Settings (⚙)

  • Language, theme, font size, log timestamp format and the number of lines kept on screen.
  • «Start file log automatically» and the auto-log folder: each connection writes «portdock-scpi-date-time.log».
  • «Export / Import settings» move the connection settings, command list and repeat measurement settings as a JSON file.
  • «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.
  • 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.
  • Enter: in the command box, query (ends in ?) or write. ↑↓: earlier commands.
  • Esc: stop a pending query or the repeat measurement (outside the command box).

Troubleshooting

  • «Connection refused»: wrong port (not every instrument uses 5025 — see «socket port» in the manual) or the socket service is off. Some instruments refuse new connections while another program (a VISA session) is connected.
  • «No reply (timed out)»: a non-query sent as a query, a typo (check the error queue), or a slow measurement (raise «Response timeout» or use *OPC?).
  • «The reply did not end»: the «Line ending» does not match the instrument (some use CR).
  • -410 Query INTERRUPTED: a new command was sent before the answer was read. If you sent a query with «Write», take the answer with «Read» first.
  • Garbled serial text: check baud, parity and data bits, flow control (does the instrument use DTR/DSR or RTS/CTS?) and whether a null-modem cable is needed.
  • The program does not open: Microsoft Edge WebView2 is required (included in Windows 11).