VNAs can be readily automated and there are numerous options for users to do so. To help illustrate the different automation methods and interfaces available, consider the components in an automated VNA measurement system. There is hardware: the VNA itself and a computer. There is software, as well: the VNA control software loaded onto the computer. While non-automated use of these components consists of each of these components in this basic configuration, automation options alter this configuration. For instance, an instrument can be locally or remotely automated. In local automation, an automating program executes on the same computer that is connected to the VNA and has the VNA control software. This is the same basic configuration. On the other hand, in remote automation, another computer, connected to the first by a network, runs the automation program. Automation of Copper Mountain Technologies’ VNAs can be achieved by using either of two interfaces:
COM automation is well suited for local automation, where the automation software and the VNA control software both execute on the same Windows PC. This PC must be located within a USB cable’s reach of the VNA being automated, generally meaning within a 5-meter radius, though there are technologies available for extending USB over distances of many meters (i.e. conversion to fiber optic or use of a wired or wireless USB sharing hub).
DCOM automation is suited for remote automation. The procedure is quite involved, requiring various user account authorization settings and a firewall opening which might not be practical in some network environments. If a network between Windows PCs can be configured as a Workgroup – typically found in home network scenarios – DCOM may be a practical approach.
The COM/DCOM interface is a Microsoft product and can only be used in a Windows or virtual Windows environment. COM/DCOM automation is supported by LabVIEW, MATLAB, Python (with the PyWin32 package), VB.NET, VBA, C++, C#, VEE, Octave, and more. Because it is a software-to-software interface, data transfer times are negligible. Additionally, depending on the programming environment, the COM properties structure might be directly explored and command syntax auto-completed – a convenient addition to help avoid typos. In summary, The COM interface works well for local automation in a Windows or virtual Windows environment and can even have unique benefits. However, it is difficult to set up DCOM for remote automation.
In automation under the TCP interface, the connection between the automation program and the VNA control software is established through TCP/IP sockets and the network stack of the computer. Through these, the automation program can send (industry-standard) Standard Commands for Programmable Instruments (SCPI) commands to the VNA control software, either locally on the same computer or remotely across a network.
SCPI is a standard protocol for communicating with instruments using ASCII-based commands to control the device and ASCII encoding to send and receive data. It is a relatively easy to use protocol because of its straightforward encoding.
Local automation can be accomplished via the special IP address 127.0.0.1 (also known as ‘localhost’) together with port number 5025. This makes it simple to connect to a VNA over LAN, because no special network configuration is typically required beyond possibly port forwarding for remote connections across the internet.
TCP has its own drawbacks. To query the device, you must first send a command and then read the response. SCPI uses ASCII to transfer data, so all data will be read as strings and must be later converted. Generally, programming environments will not be aware of valid and invalid SCPI command syntaxes, so errors due to typos are more likely to occur. Finally, using the TCP socket will introduce delays due to the latencies and bandwidth limitations of the network stack.
Before starting this lab, there are few practices one should keep in mind. They are as follows:
Link to this complete calibration procedure video is as follows - https://coppermountaintech.wistia.com/medias/90gsd3yb3x
To learn the basics of VNA Test Automation. Pre-requisite
(For other codes, https://coppermountaintech.com/automation/ )
#Import VISA library and Matplotlib to plot data
import visa
import matplotlib.pyplot as plt
#Connect to a Socket on the local machine at 5025
#Use the IP address of a remote machine to connect to it instead rm = visa.ResourceManager() try:
#Enable socket server in the VNA software System > Misc Setup > Network Remote Control Settings > Socket Port - 5025 > Socket Server - ON
CMT = rm.open_resource('TCPIP0::localhost::5025::SOCKET')
except:
print("Failure to connect to VNA!")
print("Check network settings")
#The VNA ends each line with this. Reads will time out without this CMT.read_termination='\n'
#Set a long timeout period for slow sweeps CMT.timeout = 200000 #Change stimulus to BUS based triggers CMT.write('TRIG:SOUR BUS\n') CMT.query("*OPC?\n")
#Trigger a measurement CMT.write('TRIG:SEQ:SING\n') #Wait for sweep completion CMT.query("*OPC?\n")
#Read data Freq = (CMT.query("SENS1:FREQ:DATA?\n")) #Get frequency data as a string
S11 = (CMT.query("CALC1:TRAC1:DATA:FDAT?\n")) #Get displayed formatted data as a string S21 = (CMT.query("CALC1:TRAC2:DATA:FDAT?\n")) #Get displayed formatted data as a string
#split the long strings into a string list #also take every other value from magnitudes since second value is 0
#If complex data were needed we would use polar format and the second #value would be the imaginary part
Freq = Freq.split(",") S11 = S11.split(",") S11 = S11[::2]
S21 = S21.split(",") S21 = S21[::2]
#Change the string values into numbers for plotting
S11 = [float(s) for s in S11]
S21 = [float(s) for s in S21]
Freq = [float(f)/1e6 for f in Freq]
#Plot results
plt.title('BandPass Filter S11 and S21 Plot')
plt.plot(Freq,S11)
plt.plot(Freq,S21)
Your plot of S11 and S21 for a bandpass filter may look like the one given below. If you use low-pass filter instead, compare your results with the ones obtained for Low Pass (LP) filter lab.