📡 Keysight PNA 4-portVerified: N5222A
Measures all 16 S-parameters (S11–S44) on a 4-port PNA-series analyzer. Should also work with PNA-L and PNA-X — adjust port count and trace definitions as needed.
Home / Docs / Instrument Remote Control
Connect your network analyzer over LAN and download S-parameter data directly into TstoneLab — no file copying, no USB drives.
Overview
TstoneLab can communicate with your network analyzer over a TCP/IP network. You write a SCPI command sequence that tells the instrument what to measure; TstoneLab runs it, downloads the resulting Touchstone file, and opens it immediately in a QuickChart tab.
This guide covers:
Step 1
Your PC and your instrument must be on the same network.
Using a lab network (typical): If your PC and instrument are on the same lab network (Ethernet switch or Wi-Fi), they should already be reachable. Find the instrument's IP address from its front panel (usually under System → Network or similar).
Using a direct Ethernet cable (point-to-point): With a single cable and no router or switch in between, there is no DHCP server to assign addresses, so you must set a static IP on both sides.
The key rule: both devices must share the same network prefix — the part of the address defined by the subnet mask must be identical. With a mask of 255.255.255.0, the first three octets (192.168.1.___) define the network. Any two devices whose addresses start with 192.168.1. and use this mask are on the same network and can communicate directly. Only the last octet must differ.
Example configuration:
| Device | IP address | Subnet mask |
|---|---|---|
| Your PC | 192.168.1.10 | 255.255.255.0 |
| Instrument | 192.168.1.100 | 255.255.255.0 |
Both addresses share the 192.168.1.x prefix. The PC is .10 and the instrument is .100 — same network.
You can pick any values (e.g., 10.0.0.1 and 10.0.0.2 with 255.255.255.0), as long as both devices share the same prefix and have different host addresses. The example above is just a common convention.
Verify connectivity. Open a command prompt and ping your instrument:
ping 192.168.1.100
If you get replies, you are ready to connect.
Step 2
TstoneLab communicates with instruments using the VISA (Virtual Instrument Software Architecture) standard, so you need a VISA runtime installed on your PC. Any of these will work — they are free and interchangeable regardless of your instrument's brand:
| VISA runtime | Vendor |
|---|---|
| Keysight IO Libraries Suite | Keysight |
| NI-VISA | National Instruments |
| R&S VISA | Rohde & Schwarz |
Tested with Keysight IO Libraries Suite. The other runtimes should also work, since TstoneLab calls the standard visa64.dll C API that all three vendors implement to the same IVI-VISA specification.
After installation, restart your PC. The VISA runtime places visa64.dll in your System32 folder, which TstoneLab uses at runtime.
Step 3
TCPIP::<IP_ADDRESS>::<port>::SOCKET
TCPIP::<IP_ADDRESS>::hislip0::INSTR
TCPIP::192.168.1.100::hislip0::INSTR TCPIP::192.168.1.100::5025::SOCKET
*IDN?, and shows your instrument's identification string (manufacturer, model, serial number, firmware version).Step 4
Every network analyzer has its own SCPI syntax. The commands for a Keysight PNA differ from a Rohde & Schwarz ZNB, which differ from an Anritsu VectorStar. You are responsible for writing the correct SCPI commands for your specific instrument.
TstoneLab provides a step-by-step SCPI editor where you define a measurement sequence. Each step is one of:
| Step type | What it does |
|---|---|
| Write | Sends a SCPI command to the instrument (no response expected). |
| Query | Sends a SCPI command and reads the text response. |
| WaitOpc | Sends *OPC? and waits until the instrument signals completion. |
| ReadSnpBinary | Sends a command and reads back binary block data (your Touchstone file). |
| ReadSnpText | Sends a command and reads back text data as the Touchstone file. |
A typical sequence has four sections:
Starting points
TstoneLab ships with two verified presets you can load as starting points:
Measures all 16 S-parameters (S11–S44) on a 4-port PNA-series analyzer. Should also work with PNA-L and PNA-X — adjust port count and trace definitions as needed.
Measures S11, S21, S12, S22 on a FieldFox handheld in network analyzer mode. Should work with other FieldFox NA-capable models (N9913–N9952).
These presets are examples. If you use a different brand or model, you will need to create your own sequence.
Step 5
ReadSnpBinary (or ReadSnpText) step completes, the downloaded Touchstone data is saved to:Documents\TstoneLab\InstrumentData\
N5222A_20260407_143052.s4p.Pro tip
Writing SCPI from scratch is tedious when your instrument has hundreds of commands. A practical shortcut:
"<your model> SCPI programming guide" — it's usually a PDF.I use a [Your Instrument Brand/Model], a [N]-port Network Analyzer. Below is a SCPI command sequence for a Keysight PNA (4-port) that works with an app called TstoneLab. Please adapt it for my instrument using the attached SCPI manual. The sequence must follow this structure: - Setup: Clear existing traces, configure display. - Define S-Parameters: Create traces for all S-parameters (S11 through SNN). - Measure: Set single sweep mode, trigger, wait for completion. - Transfer: Save measurement as a Touchstone (.sNp) file on the instrument, then provide the SCPI command to read that file back as a binary block. [Paste the Keysight PNA or FieldFox preset commands here] Please output the adapted sequence in the same format (Section / Command / Label).
If something goes wrong
| Symptom | What to check |
|---|---|
| "VISA runtime not found" | Install one of the three VISA runtimes above and restart your PC. |
| "Connection timeout" or "VI_ERROR_RSRC_NFOUND" | Check the instrument's IP is correct, both devices are on the same subnet, and the instrument's LAN port is enabled. Try ping <ip> from the command prompt. |
| "Measurement returns empty data" | Make sure the Transfer section saves the file in Touchstone (.sNp) format, not CITIFILE or MDIF. Verify the file path on the instrument. |
| "Works on other software but not here" | Some instruments require a specific line termination. TstoneLab sends commands with a newline (\n); if your instrument expects \r\n, you may need to adjust. |
At a glance
| Step | Action |
|---|---|
| 1 | Put your PC and instrument on the same network |
| 2 | Install a free VISA runtime (Keysight, NI, or R&S) |
| 3 | Connect via VISA address in TstoneLab |
| 4 | Write or load a SCPI command sequence for your instrument |
| 5 | Click Measure — file saved to Documents\TstoneLab\InstrumentData\ |
| 6 | File appears in Explorer — QuickChart tab opens automatically |