Home / Docs / Instrument Remote Control

Instrument Remote Control (VISA / SCPI)

Connect your network analyzer over LAN and download S-parameter data directly into TstoneLab — no file copying, no USB drives.

Overview

How it works

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:

  1. Network setup
  2. Installing a VISA runtime
  3. Connecting to your instrument
  4. Writing a SCPI command sequence
  5. Running a measurement
  6. Tip — using AI to write SCPI commands for your instrument

Step 1

Network setup

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:

DeviceIP addressSubnet mask
Your PC192.168.1.10255.255.255.0
Instrument192.168.1.100255.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:

Command Prompt
ping 192.168.1.100

If you get replies, you are ready to connect.

Step 2

Install a VISA runtime

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 runtimeVendor
Keysight IO Libraries SuiteKeysight
NI-VISANational Instruments
R&S VISARohde & 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

Connecting to your instrument

  1. In TstoneLab, click Connect Instrument (from the left panel or the Quick Actions area).
  2. Type your instrument's VISA address. The format is:
    VISA address format
    TCPIP::<IP_ADDRESS>::<port>::SOCKET
    or for HiSLIP:
    HiSLIP
    TCPIP::<IP_ADDRESS>::hislip0::INSTR
    Common examples:
    Examples
    TCPIP::192.168.1.100::hislip0::INSTR
    TCPIP::192.168.1.100::5025::SOCKET
  3. Click Connect. TstoneLab opens a VISA session, sends *IDN?, and shows your instrument's identification string (manufacturer, model, serial number, firmware version).
  4. Once connected, the SCPI Editor tab opens automatically.

Step 4

Writing a SCPI command sequence

⚠️

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 typeWhat it does
WriteSends a SCPI command to the instrument (no response expected).
QuerySends a SCPI command and reads the text response.
WaitOpcSends *OPC? and waits until the instrument signals completion.
ReadSnpBinarySends a command and reads back binary block data (your Touchstone file).
ReadSnpTextSends a command and reads back text data as the Touchstone file.

A typical sequence has four sections:

  1. Setup — Clear existing traces, configure display windows.
  2. Define S-parameters — Create trace definitions (S11, S21, S12, S22, etc.).
  3. Measure — Set single sweep mode, trigger a measurement, wait for completion.
  4. Transfer — Save the Touchstone file on the instrument, then download it to your PC.

Starting points

Built-in presets (verified instruments)

TstoneLab ships with two verified presets you can load as starting points:

📡 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.

📶 Keysight FieldFox 2-portVerified: N9918A

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

Running a measurement

  1. Use the SCPI Editor to load a preset or build your own.
  2. Click Measure. TstoneLab executes each step sequentially and shows progress.
  3. When the ReadSnpBinary (or ReadSnpText) step completes, the downloaded Touchstone data is saved to:
    Save location
    Documents\TstoneLab\InstrumentData\
    The filename includes your instrument model and a timestamp, for example N5222A_20260407_143052.s4p.
  4. The file shows up under the Instruments node in the Explorer tree.
  5. A new QuickChart tab opens immediately with your S-parameter traces.

Pro tip

Use AI to write SCPI commands for your instrument

Writing SCPI from scratch is tedious when your instrument has hundreds of commands. A practical shortcut:

  1. Download your instrument's SCPI manual. Search the manufacturer's website for "<your model> SCPI programming guide" — it's usually a PDF.
  2. Provide it to an assistant (such as Claude or ChatGPT) along with one of TstoneLab's example presets and a prompt like this:
    Prompt template
    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).
  3. Review and test. The AI may not get everything right on the first try — always verify against your manual.
  4. Paste the commands into TstoneLab's SCPI Editor, save as a named sequence, and run it.

If something goes wrong

Troubleshooting

SymptomWhat 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

Summary

StepAction
1Put your PC and instrument on the same network
2Install a free VISA runtime (Keysight, NI, or R&S)
3Connect via VISA address in TstoneLab
4Write or load a SCPI command sequence for your instrument
5Click Measure — file saved to Documents\TstoneLab\InstrumentData\
6File appears in Explorer — QuickChart tab opens automatically