Anritsu VNA Instruction and Codes

Vector network analyzers (VNAs) are test instruments that measure electrical network parameters, essential for radio frequency (RF) and microwave component analysis. When prototyping metasurfaces, near-field VNA measurements must come first before moving to the far-field deployment.

Because VNAs/PNAs at mmWave frequency are super expensive and heavy, I’ve gone to different labs (at UMass and at Princeton) and used their analyzers.

One problem I faced with measuring my voltage-controlled metasurfaces (mmWall, Wall-E) is that I need to measure a lot of voltage configurations (0V to 16V for both magnetic and electric side). Using a finer voltage granularity provides better performance (i.e., more accurate selection of a phase shift), so I chose a voltage increase with a step of 0.2V. This means that I need to make a measurement for each of 81 x 81 different voltage configurations.

I knew that I would never be able to make my deadline if I manually saved each of 6561 data points, so I automated the process. The process is simple:

  1. Connect the surface controller and VNA to the laptop.
  2. The MATLAB code operating on the laptop changes the voltage configuration and then sends the save command to the VNA.
  3. This repeats 6561 times.

With a brand new Keysight N5247A VNA model (at UMass), this was very simple since it supported MATLAB programming, and the Keysight Tech Support team was very kind and supportive.

However, for the Anritsu MS4647B VNA, the process was quite complex (as far as I remember, it only supports LabVIEW), and I always thought I should document my codes in case anyone needs the instructions in the future (also for myself)."

Anritsu VNA Instruction

Basic logic is that (1) the sockets are opened between MATLAB code and LABVIEW code, (2) matlab code sends the filename to the labview, (3) which triggers labview code to control the Anritsu VNA and save the data. (4) The labview code return the received filename to the matlab code for confirm that the file has been saved.



  • Set frequency range on Anritsu first before starting the calibration. It cannot be changed after calibration.
  • Set up LabView VI ethernet connection before starting the calibration. After controlling Anritsu through LabView, the screen is not adjustable.
  • Connect each port with a mmWave cable and 2.92 mm (K) F to SMA F adapter
  • Port 1 (Open, Short, 50 ohm Impedance), Port 1 (Open, Short, 50 ohm Impedance), Thru
  • Capture the baseline measurement before collecting traces.


  • Connect Anritsu with the computer via Ethernet
  • Order of execution: VNACollect.m –>
  • In the Labview file, the directory where you want to save your file should be added. The way to change the directory is Openning -> Window -> Show Block Diagram -> replace “C:\Users\lakwe\Dropbox (Princeton)\mmWall2\code\VNAData\081023\prototype2_0.2V_test6\txt" to your own. Also, change “:SENSE:SWEEP:POINTS 81” under data point number to your own number of frequency sample points.

Troubleshooting the Ethernet connection between LabView and Anritsu (error code 0xBFFF0011):

The files are available in my Github Repo:

KeySight VNA Instruction

The MATLAB code for KeySight VNA is also included in the GitHub Repo.

Later on…

I will next document the instruction on the Analog Device DAC (EVAL-AD5370) at some point because the available software from the Analog Device is very poor and has a lot of bugs (not usuable in real-time)… I’ve programmed this DAC using both Microsoft Visual C++ (via USB connection with Windows) and python (via SPI + GPIO with Raspberry Pi), so I should document both of them and compare pro and cons (I personally think the second one is far better).

Kun Woo Cho
Kun Woo Cho

My research interests include wireless networked systems, smart surface, and AI-assisted networks.