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.
JavaScript
x
70
70
1
import string
2
3
import pyvisa # PyVISA package for connecting to the instrument
4
5
6
7
pyvisa.log_to_screen()
8
9
10
11
# Make connection to instrument
12
13
# Open a VISA resource manager pointing to the installation folder for the Keysight Visa libraries.
14
15
rm = pyvisa.ResourceManager()
16
17
18
19
# Device addr
20
21
addr_MXA = 'TCPIP0::A-N9020A-00060::inst0::INSTR'
22
23
addr_VSA = 'TCPIP0::CASCODA500::hislip1::INSTR'
24
25
SA_device = rm.open_resource(addr_VSA)
26
27
28
29
# Preset and wait for operation to complete
30
31
SA_device.write('*rst')
32
33
SA_device.query('*opc?')
34
35
36
37
# Resume the sweeping
38
39
SA_device.write('init:cont ON')
40
41
SA_device.write('init:res')
42
43
44
45
# Measurement variables for the MeasSetup
46
47
freq = '2.44GHz'
48
49
freq_span = '5MHz'
50
51
count = 10
52
53
avermode = 'EXP'
54
55
search_len = '832us'
56
57
58
59
SA_device.write('sens:freq:cent {}'.format(freq))
60
61
SA_device.write('sens:freq:span {}'.format(freq_span))
62
63
# Average
64
65
SA_device.write('sens:aver ON')
66
67
SA_device.write('sens:mon:aver:tcon {}'.format(avermode))
68
69
SA_device.write('sens:aver:count {}'.format(count))
70
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.