10-26-2004 12:22 PM
10-29-2004 02:45 PM
04-29-2011 04:20 AM
Hi,
I am also getting this error when I am trying to access HP 8696E Electrical Spectrum Analyzer (ESA). I don't have any problem accessing other devices in the GPIB ENET 100. Once I connect ESA to the system I start getting this problem. I am also attaching my python code along with this. Is it that I am not stopping the GPIB session properly?
Please let me know if it is possible to solve this issue. I am sitting on this problem for a long time now!!
Thank you,
Aravind [EE10D037, IIT Madras , India].
Python Code:
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
import visa
from xlwt import *
from visa import *
print "started ESA acquiring!!"
esa=instrument("GPIB::18")
esa.write("TDF P;")
esa.write("FA 0HZ;")
start_freq=0
print "Start Frequency = ",start_freq,"Hz"
esa.write("FB 1000000000HZ;")
stop_freq=1000000000
print "Stop Frequency= ",stop_freq, "Hz"
esa.write("SNGLS;")
esa.write("TS;")
esa.write("TRA?;")
power = esa.read()
print power
w=Workbook()
ws=w.add_sheet("ESA Power readings")
ws.col(0).width=5000
ws.col(2).width=5000
powerList = power.split(',')
pow = ','.join(powerList)
power = [float(i) for i in pow.split(',')] #convert CSV to array to enable storing
freq_len = start_freq
freq_len1 = float(freq_len)
start_freq1=float(start_freq)
stop_freq1=float(stop_freq)
#power1 =float(power)
ws.write(0,0,"Frequency (Hz)")
ws.write(0,2,"Power (dBm)")
for i in range(1,len(power)+1):
ws.write(i,2,power[i-1])
ws.write(i,0,freq_len1)
freq_len1=freq_len1+((stop_freq1-start_freq1)/len(power))
esa.write("RB?;")
RBW = esa.read();
print RBW
esa.write("VB?;")
VBW = esa.read();
esa.write("RL?;")
RL = esa.read();
esa.write("ST?;")
ST = esa.read()
ws.write(0,3,"Sweep time (ms)")
ws.write(1,3,ST)
ws.write(0,4,"RBW (Hz)")
ws.write(1,4,RBW)
ws.write(0,5,"VBW (Hz)")
ws.write(1,5,VBW)
ws.write(0,6,"RL (dBm)")
ws.write(1,6,RL)
w.save("TLSLWM1.xls")
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Error after line : esa = instrument("GPIB::18");
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
esa = instrument("GPIB::18")
File "C:\Python26\lib\site-packages\pyvisa\visa.py", line 290, in instrument
return GpibInstrument(resource_name, **keyw)
File "C:\Python26\lib\site-packages\pyvisa\visa.py", line 594, in __init__
Instrument.__init__(self, resource_name, **keyw)
File "C:\Python26\lib\site-packages\pyvisa\visa.py", line 358, in __init__
"lock")))
File "C:\Python26\lib\site-packages\pyvisa\visa.py", line 132, in __init__
keyw.get("lock", VI_NO_LOCK))
File "C:\Python26\lib\site-packages\pyvisa\vpp43.py", line 753, in open
byref(vi))
File "C:\Python26\lib\site-packages\pyvisa\vpp43.py", line 398, in check_status
raise visa_exceptions.VisaIOError, status
VisaIOError: VI_ERROR_NCIC: The interface associated with this session is not currently the controller in charge.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------