Download Print this page
Keysight Technologies N437 Series Application Note

Keysight Technologies N437 Series Application Note

Lightwave component analyzer automation - getting started with scpi
Hide thumbs Also See for N437 Series:

Advertisement

Quick Links

Keysight Technologies
N437x Lightwave Component Analyzer
Automation – Getting Started with SCPI
Application Note

Advertisement

loading
Need help?

Need help?

Do you have a question about the N437 Series and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Keysight Technologies N437 Series

  • Page 1 Keysight Technologies N437x Lightwave Component Analyzer Automation – Getting Started with SCPI Application Note...
  • Page 2 Introduction The Keysight N437x Series Lightwave Component Analyzer (LCA) is a solution which integrates a vector network analyzer (VNA) along with a calibrated lightwave test set to measure the transfer function of electrical to electrical (EE), electrical to optical (EO), optical to electrical (OE), and optical to optical (OO) components. Similar to a vector network analyzer both the magnitude and phase response of a component are characterized as a function of frequency.
  • Page 3 03 | Keysight | N437x Lightwave Component Analyzer Automation – Getting Started with SCPI - Application Note i) Define VNA measurement settings and perform electrical calibration – VNA application The VNA settings such as start and stop frequency, number of measurement points, and IF bandwidth are set for a specific measurement.
  • Page 4 04 | Keysight | N437x Lightwave Component Analyzer Automation – Getting Started with SCPI - Application Note PNA/ENA Automation There are two series of Keysight VNAs which are integrated into the N437x Series LCA. The low frequency N4374B LCA incorporates an E5071C ENA, while the higher frequency N437x LCA use the N522x PNA.
  • Page 5 05 | Keysight | N437x Lightwave Component Analyzer Automation – Getting Started with SCPI - Application Note Table 2: SCPI Commands for ENA/PNA Automation Operation Instrument Reset :SYST:PRES :SYST:PRES Save Instrument State :MMEMory:STORe 'filename.csa' :MMEM:STOR 'filename.sta' Recall Instrument State :MMEM:LOAD 'filename.csa' :MMEM:LOAD 'filename.sta' Start Frequency :SENS1:FREQ:STAR <double>...
  • Page 6 06 | Keysight | N437x Lightwave Component Analyzer Automation – Getting Started with SCPI - Application Note #Define VNA as PNA or ENA inst_VNA 'PNA' #Preset instrument and wait until complete myVNA.write(':SYST:PRES') myVNA.write('*OPC?') ('VNA Reset Complete: ' + myVNA.read()) print #Recall instrument state which includes electrical calibration inst_VNA == 'PNA':...
  • Page 7 07 | Keysight | N437x Lightwave Component Analyzer Automation – Getting Started with SCPI - Application Note LCA Automation Traditionally, the LCA application is automated using Microsoft .NET remoting over a LAN interface. This requires that a remote client is installed on the control PC. To automate the LCA, the control program calls the methods and properties of the remote client which in turn communicates with the server running on the LCA via LAN.
  • Page 8 08 | Keysight | N437x Lightwave Component Analyzer Automation – Getting Started with SCPI - Application Note Figure 1. Typical LCA Macro GUI tab for performing OE Measurements After the measurement parameters are defined, the instrument is initialized by pressing the ‘Start’ button which sends the parameters to the LCA to set up the measurement.
  • Page 9 09 | Keysight | N437x Lightwave Component Analyzer Automation – Getting Started with SCPI - Application Note Table 3: SCPI Commands for each LCA parameter GUI Control SCPI Command Measurement Mode Start :MEAS:INIT:EE :MEAS:INIT:EO :MEAS:INIT:OE :MEAS:INIT:OO Abort :MEAS:ABOR EE / EO / OE / OO Advanced :PAR:ADVA:MODE 0/1 EO / OE / OO...
  • Page 10 10 | Keysight | N437x Lightwave Component Analyzer Automation – Getting Started with SCPI - Application Note LCA Automation – Starting the SCPI Server Prior to sending any SCPI commands to the LCA, the user needs to close the LCA application and start the LCA SCPI Server as shown in the images below.
  • Page 11 11 | Keysight | N437x Lightwave Component Analyzer Automation – Getting Started with SCPI - Application Note Figure 3. Starting SCPI Server on the LCA Once the SCPI server is active we can test the connection between the control PC and the LCA using the Keysight Connection Expert (KCE).
  • Page 12 12 | Keysight | N437x Lightwave Component Analyzer Automation – Getting Started with SCPI - Application Note Once the Keysight Connection Expert has started, the steps to add a LAN Socket Connection are shown below in Figure 5. A similar approach could be used for a USB connection. The only information which is required to connect with the LCA via a socket connection is the ‘Host Name’...
  • Page 13 13 | Keysight | N437x Lightwave Component Analyzer Automation – Getting Started with SCPI - Application Note Figure 6: Sending Commands to the LCA SCPI Server After closing the Keysight Interactive IO application we can send commands to the LCA SCPI server from the automation environment.
  • Page 14 14 | Keysight | N437x Lightwave Component Analyzer Automation – Getting Started with SCPI - Application Note LCA Example #*IDN? - Query Instrumnet ID myLCA.write('*CLS') myLCA.write('*IDN?') print ('LCA ID: ' + myLCA.read()) #Init LCA to EE Mode print ('Init EE InProgress') myLCA.write(':MEAS:INIT:EE') myLCA.write(':MEAS:CURR:TYPE?')
  • Page 15 15 | Keysight | N437x Lightwave Component Analyzer Automation – Getting Started with SCPI - Application Note Summary In order to successfully automate the LCA, a control program needs to interface with both the VNA and the LCA. This paper summarized the available interfaces and SCPI commands to automate the LCA.
  • Page 16: Appendix A) Troubleshooting Tips

    16 | Keysight | N437x Lightwave Component Analyzer Automation – Getting Started with SCPI - Application Note Appendix A) Troubleshooting Tips – Make sure the SCPI server has been started on the instrument. – ‘Reset LCA System’ and ‘Reset Remote Interface’ from the LCA Server as below if the expected behavior is not observed.
  • Page 17 17 | Keysight | N437x Lightwave Component Analyzer Automation – Getting Started with SCPI - Application Note – Monitor the ‘Keysight Translator Framework’ on the VNA as commands are sent to the LCA. This can provide helpful troubleshooting information if a command is not recognized.
  • Page 18 18 | Keysight | N437x Lightwave Component Analyzer Automation – Getting Started with SCPI - Application Note – Activate the ‘Keysight IO Monitor’ on the control PC to monitor the commands being sent to the LCA or VNA along with the data being returned from the instrument. This can provide useful information to help troubleshoot command syntax issues and problems with VISA termination characters.
  • Page 19: Appendix B) Python Example Program

    19 | Keysight | N437x Lightwave Component Analyzer Automation – Getting Started with SCPI - Application Note Appendix B) Python Example Program # Import python modules visa import time import numpy as np import import matplotlib.pyplot as plt # define VNA_LCA Functions recall_state_VNA(mystate): #Recall Instrument State myVNA.write(':MMEM:LOAD '...
  • Page 20 20 | Keysight | N437x Lightwave Component Analyzer Automation – Getting Started with SCPI - Application Note myVNA.write('*OPC?') ('ENA trace save complete: ' + myVNA.read()) print get_err_VNA(): #query VNA Errors myVNA.write(':SYST:ERR?') myVNAerr = myVNA.read() myVNAerr return set_LCA_OE(mymeas, mywave, myopt_pow, mymod_opt, myrf_pow): #set_LCA_OE Code myLCA.write(':PAR:MEAS:MODE ' + mymeas)
  • Page 21 21 | Keysight | N437x Lightwave Component Analyzer Automation – Getting Started with SCPI - Application Note 123. 124. get_err_LCA(): 125. #query LCA errors 126. myLCA.write(':SYST:ERR?') 127. myLCAerr = myLCA.read() 128. myLCAerr return 129. 130. #define if using ENA or PNA 131.
  • Page 22 22 | Keysight | N437x Lightwave Component Analyzer Automation – Getting Started with SCPI - Application Note 183. print ('VNA ID: ' + myVNA.read()) 184. 185. myLCA.write('*CLS') 186. myLCA.write('*IDN?') 187. print ('LCA ID: ' + myLCA.read()) 188. 189. #Preset VNA 190.
  • Page 23 23 | Keysight | N437x Lightwave Component Analyzer Automation – Getting Started with SCPI - Application Note 244. #Query Trace Count CALC1:PAR:COUNT? 245. myVNA.write('CALC1:PAR:COUNT?') 246. trace_count = myVNA.read() 247. 248. range(1,int(trace_count)+1): 249. #Save VNA data as *.csv files for each trace 250.
  • Page 24 For other unlisted countries: www.keysight.com/find/contactus (BP-9-7-17) DEKRA Certified ISO9001 Quality Management System www.keysight.com/go/quality Keysight Technologies, Inc. DEKRA Certified ISO 9001:2015 Quality Management System This information is subject to change without notice. © Keysight Technologies, 2017 Published in USA, December 1, 2017 5992-2126EN www.keysight.com...

This manual is also suitable for:

N4374b