I am trying to set up the signal analyser using a simple python script. I am able to set the center and frequency and span frequency but when i am trying to turn the average on and set it to exponential mode, it gives me a pass through command ignored. The instrument is connected successfully using LAN.
import string import pyvisa # PyVISA package for connecting to the instrument pyvisa.log_to_screen() # Make connection to instrument # Open a VISA resource manager pointing to the installation folder for the Keysight Visa libraries. rm = pyvisa.ResourceManager() # Device addr addr_MXA = 'TCPIP0::A-N9020A-00060::inst0::INSTR' addr_VSA = 'TCPIP0::CASCODA500::hislip1::INSTR' SA_device = rm.open_resource(addr_VSA) # Preset and wait for operation to complete SA_device.write('*rst') SA_device.query('*opc?') # Resume the sweeping SA_device.write('init:cont ON') SA_device.write('init:res') # Measurement variables for the MeasSetup freq = '2.44GHz' freq_span = '5MHz' count = 10 avermode = 'EXP' search_len = '832us' SA_device.write('sens:freq:cent {}'.format(freq)) SA_device.write('sens:freq:span {}'.format(freq_span)) # Average SA_device.write('sens:aver ON') SA_device.write('sens:mon:aver:tcon {}'.format(avermode)) SA_device.write('sens:aver:count {}'.format(count))
Advertisement
Answer
This happens because I was trying to use SCPI commands for MXA N9020A instrument on 89600 VSA software running on the computer. This is solved by downloading Keysight Command Expert and use the commands that are tailored for different instruments and also using SCPI reference guide here.