skrf.vi.vna.nanovna.NanoVNAv2

class skrf.vi.vna.nanovna.NanoVNAv2(address, backend='@py')[source]

NanoVNAv2.

This class connects to the NanoVNA V2 using a binary protocol over USB. It should also be compatible with other devices, if they use the same protocol. Some variants of the NanoVNA use a text protocol and are not supported.

Warning

The NanoVNA V2 only returns uncalibrated networks, regardless of the calibration on the device itself. See section Examples.

Notes

Tested devices:

Examples

Basic S11 and S21 measurement:

import skrf
from skrf.vi.vna.nanovna import NanoVNAv2

vna = NanoVNAv2("ASRL/dev/ttyACM0::INSTR")  # Linux
# vna = NanoVNAv2("ASRL1::INSTR")  # Windows
freq = skrf.Frequency(start=1, stop=2, unit='GHz', npoints=101)
s11, s21 = vna.get_s11_s21()

1-port calibration assuming ideal reference standards:

import skrf

# load uncalibrated measurement
raw_s1p = skrf.Network("measurement.s1p")

# load s1p networks of measured standards
cal_measured = [skrf.Network("short.s1p"), skrf.Network("open.s1p"), skrf.Network("load.s1p"]

# get ideal standards
line = skrf.DefinedGammaZ0(frequency=cal_measured[0].frequency, z0=50)
cal_ideals = [line.short(nports=1), line.open(nports=1), line.match(nports=1)]

# run calibration
cal = skrf.OnePort(ideals=cal_ideals, measured=cal_measured)
cal.run()

# apply calibration
calibrated_s1p = cal.apply_cal(raw_s1p)
Parameters:

backend (str)

Attributes

device_info

freq_start

freq_step

freq_stop

frequency

id

npoints

timeout

Methods

__init__

clear_fifo

command

Create a property for the instrument.

get_s11_s21

get_sdata

Get S-parameter as 1-port skrf.Network.

get_snp_network

Get custom n-port skrf.Network.

query

query_values

read

read_values

write

write_values